Upper Case First Character in a Text using C#
|
|
public static string UppercaseFirst(string text) //using ToCharArray; it is faster than traditional way
{
if (text.Length > 0)
{
char[] a = text.ToCharArray();
a[0] = char.ToUpper(a[0]);
return new string(a);
}
else
return "";
}
Categories: Personal, Public, C#
Post a Comment
Oops!
The words you entered did not match the given text. Please try again.
Oops!
Oops, you forgot something.