1
2
3
4
5
6
7
8
9
10
11
12
/// <summary>
/// Returns the input string with the first character converted to uppercase
/// </summary>
public static string FirstLetterToUpperCase(this string s)
{
if (string.IsNullOrEmpty(s))
throw new ArgumentException("There is no first letter");

char[] a = s.ToCharArray();
a[0] = char.ToUpper(a[0]);
return new string(a);
}