public static string TitleCase(string str)
{
if(String.IsNullOrWhiteSpace(str)) {
throw new ArgumentNullException("value");
}
StringBuilder result = new StringBuilder(str.ToLower());
result[0] = char.ToUpper(result[0]);
for( int i = 1; i < result.Length; ++i )
{
if( char.IsWhiteSpace(result[i - 1]) ) {
result[i] = char.ToUpper(result[i]);
}
}
return result.ToString();
}