Wednesday, 7 July 2010

CONVERT LOWERCASE AND UPPERCASE TO TITLECASE IN .NET

  1. string strLow = "lower case";
  2. string strT = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(strLow);
  3. Console.WriteLine("Lower Case to Title Case: " + strT);
  4. string strCap = "UPPER CASE";
  5. strT = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(strCap.ToLower());
  6. Console.WriteLine("Upper Case to Title Case: " + strT);

No comments:

Post a Comment