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: ,

 

Digital Colony Copyright © 1999-2008 XHTML   508
This site uses Blogger, which is not 100% XHTML compliant.
Try...Catch Disclaimer: For brevity many examples do not include error handling. That is your responsibility.