There seems to be a lot of complexity here when all you need is:
/// <summary> /// Returns the input string with the first character converted to uppercase if a letter /// </summary> /// <remarks>Null input returns null</remarks> public static string FirstLetterToUpperCase(this string s) { if (string.IsNullOrWhiteSpace(s)) return s; return char.ToUpper(s[0]) + s.Substring(1); } Noteworthy points:
ItsIt's an extension method.
If the input is null, empty or whitespacewhite space the input is returned as is.
String.IsNullOrWhiteSpace was introduced with .NET Framework 4. This won't work with older frameworks.