Check out example codes for "letter to number converter c#". It will help you in understanding the concepts better.

Code Example 1

int index = (int)c % 32;

Code Example 2

char c = 'A';
//char c = 'b'; you may use lower case character.
int index = char.ToUpper(c) - 64;//index == 1

Learn ReactJs, React Native from akashmittal.com