public string FirstLetterToUpper(string str) { if (str == null) return null; if (str.Length > 1) return char.ToUpper(str[0]) + str.Substring(1); return str.ToUpper(); } Old answer: This makes everythis can also be written as
public string ToTitleCase(string str) { var firstword = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(str.Split(' ')[0].ToLower()); str = str.Replace(str.Split(' ')[0],firstword); return str; } Where it picks up the first letterword and converts it to uppertitle case then replaces it in the input string.
public string ToTitleCase(string str) { return CultureInfo.CurrentCulture.TextInfo.ToTitleCase(str.ToLower()); }