Upper Case First Character in a Text using C#

Posted by imomins on May 30, 2011 at 5:21 AM

 

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!

Oops, you forgot something.

Oops!

The words you entered did not match the given text. Please try again.

You must be a member to comment on this page. Sign In or Register

0 Comments