c# get first char of string code example
Example 1: c# get first 5 characters of string
string result = str.Substring(0,5);
Example 2: c# get char from string
char first = mystring[0];
char second = mystring[1];
char third = mystring[2];
Example 3: get first number in string C#
var input = "12985bwevgjb9812";
string firstDigit = new String(input.TakeWhile(Char.IsDigit).ToArray());