+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    manik's Avatar
    manik is offline Om Shanti! Recent Blog:
    Join Date
    Apr 2008
    Location
    Boston, USA
    Posts
    13,122
    Thanks
    742
    Thanked 674 Times in 543 Posts
    Blog Entries
    4
    Feedback Score
    4 (100%)

    Default How to Convert String to Title Case - ASP .NET

    How to Convert String to Title Case - ASP .NET

    Often times you might need to convert input string to title case.
    For example converting the string "mY GiaNT bREAkFST" to "My Giant Breakfast"

    Using this simple method you could convert an input string to title case

    public class Converter
    {
    public static string ConvertToTitleCase(string input)
    {
    TextInfo ti = Thread.CurrentThread.CurrentCulture.TextInfo;
    //if a word is all in upper case, ToTitleCase method is not able to convert to title case. So we would make the input string all lower case.
    return ti.ToTitleCase(input.ToLower());
    }
    }

    To use this method you can simply call the static method like this:
    string str = Converter.ConvertToTitleCase("mY GiaNT bREAkFST")
    Boston Web Developer LLC
    Free Classified Ads & BUSINESS/PROFESSIONAL SOCIAL NETWORK


  2. #2
    sbglobal's Avatar
    sbglobal is offline Sophomore Recent Blog:
    Join Date
    Aug 2010
    Location
    india
    Posts
    123
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Feedback Score
    0

    Default thanks

    thanks Dear sharing information

Similar Threads

  1. Replies: 0
    Last Post: 03-30-2010, 04:11 PM
  2. Splitting a string in coldfusion
    By Abina in forum ColdFusion
    Replies: 1
    Last Post: 02-02-2010, 12:17 PM
  3. Explode a string?
    By Abina in forum ColdFusion
    Replies: 1
    Last Post: 02-02-2010, 12:11 PM
  4. Unterminated String constant
    By sunshine in forum JavaScript & AJAX
    Replies: 0
    Last Post: 01-04-2010, 12:23 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts