c# compare first n characters of string code example
Example 1: c# get first 5 characters of string
string result = str.Substring(0,5);
Example 2: c# get certain character from string
string myString = "string";
// outputs r
print(mystring[2]);
string result = str.Substring(0,5);
string myString = "string";
// outputs r
print(mystring[2]);