You are not Logged in
Would you like to Login or Register

Today is: 10 February 2012
Check this months hot topics

ToTitleCase - Making text Title Case

Whilst returning some data from LDAP, I found that it was returning in Upper Case, I needed it to be in Title case format.

I found this method of converting to title case

Title Case converts every first letter of a word in a sentence to upper case, and the rest to lower case.

Of course you could always use Regex....

using System.Globalization;
using System.Threading;

//Create CultureInfo and TextInfo classes to use ToTitleCase method
CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture;
TextInfo textInfo = cultureInfo.TextInfo;

ClientName = textInfo.ToTitleCase(txtClientName.Text);



kick it on DotNetKicks.com del.icio.us digg Mister Wong YahooMyWeb Reddit Furl Spurl blogmarks
Danny Mehmed Skype
Author : Danny Mehmed
Published : 05 November 2008

Add Comment

Enter your comment below and it will be submitted for moderation.

Your Name

Add Tag

Please enter tags for this article, seperated by semi-colon ;

View Tag's by : # articles | # views