c# get char index in string code example
Example 1: get string character by index c#
//Returns a char
myString.[0];
//Returns a string
myString.[0].ToString();
Example 2: c# find index of character in string
string str = "Now is the time.";
int index = str.IndexOf("h");
Example 3: letter at index of string c#
string s = "hello";
char c = s[1];
// now c == 'e'