public static class Capitalize
{
public static string Word(string input)
{
if (string.IsNullOrEmpty(input))
{
return string.Empty;
}
var a = input.ToCharArray();
a[0] = char.ToUpper(a[0]);
for (var i = 1; i < a.Length; i++)
{
a[i] = char.ToLower(a[i]);
}
return new string(a);
}
public static string Sentence(string input)
{
return string.Join(" ", input.Split(' ').Select(Word));
}
}