UcFirst
Emulation of PHPs ucfirst()
Source
public static string UcFirst(this string theString)
{
if ( string.IsNullOrEmpty(theString) )
{
return string.Empty;
}
char[] theChars = theString.ToCharArray();
theChars[0] = char.ToUpper(theChars[0]);
return new string(theChars);
}
Example
"some string".UcFirst();
OR
string str = "a string";
str.UcFirst();