ToFirstAll
This method makes the caps for all words in a string
Source
public static string ToFirstAll(this string input, bool switcher)
{
return new string(input.Split(' ').
Select(n => switcher ? (n.ToArray().First().ToString().ToUpper() + n.Substring(1, n.Length - 1)) :
(n.ToArray().First().ToString().ToLower() + n.Substring(1, n.Length - 1))).
Aggregate((a, b) => a + ' ' + b).ToArray()).TrimEnd(' ');
}
Example
string result_string = "hello world!".ToFirstAll(true);
MessageBox.Show(result_string);