ToFirstAll

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);

Description

This method makes the caps for all words in a string

Details

Double click on the code to select all.

 

;