Digital Colony!

Capitalize the First Letter of a Word in C#

I noticed that a few of my labels in the right column were in lower-case. Since I wrote my own label control, I decided to add a line of code to make sure the first letter in each tag was capitalized.
string labelName;
labelName = char.ToUpper(labelName[0]) + labelName.Substring(1);

Labels: ,

posted by MAS on Jun 14, 2007

Legacy Comments

Digital Colony Copyright © 1999-2010 XHTML   508
Try...Catch Disclaimer: For brevity many examples do not include error handling. That is your responsibility.