Convert LowerCase and UpperCase to TitleCase in .NET

/ Published in: C#
Save to your folder(s)

Copy this code and paste it in your HTML
  1. string strLow = "lower case";
  2. string strT = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(strLow);
  3. Console.WriteLine("Lower Case to Title Case: " + strT);
  5. string strCap = "UPPER CASE";
  6. strT = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(strCap.ToLower());
  7. Console.WriteLine("Upper Case to Title Case: " + strT);


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.