1
2
3
4
5
6
7
8
public static string FirstCharToUpper(this string str)
{
if (string.IsNullOrEmpty(str))
throw new ArgumentException("There is no first letter");
char[] array = str.ToCharArray();
array[0] = char.ToUpper(array[0]);
return new string(array);
}