String Manipulation in C#... help.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • themoonisdown09
    New Member
    • Jul 2006
    • 11

    String Manipulation in C#... help.

    Ok, I've programmed in Visual Basic .NET for a while, but I haven't programmed much in C#. I was wondering if there is a "tcase" in C#. "tcase" in Visual Basic would capitalize the first letter in every word of the string and make the rest of the word lowercase. It would be awesome if someone could help me out. It is much easier and quicker than making the string into an array and using substring and toupper() and tolower(). Thanks.
  • Enyi
    New Member
    • Jul 2006
    • 38

    #2
    I not exactly good with string manipulation. I used this example from Microsoft's website.

    Code:
    //Get the culture property of the thread.
    CultureInfo cultureInfo   = Thread.CurrentThread.CurrentCulture;
    //Create TextInfo object.
    TextInfo textInfo = cultureInfo.TextInfo;
    // Convert it
    textInfo.ToTitleCase(title)
    Here is the URL if you want more of an explanation.



    Anyone else know any easier methods?
    Last edited by Enyi; Aug 1 '06, 03:05 AM. Reason: Forgot to add link in

    Comment

    • dotnet
      New Member
      • Jul 2006
      • 22

      #3
      I think what Enyi has specified is the only way to do in C#.

      Comment

      • themoonisdown09
        New Member
        • Jul 2006
        • 11

        #4
        Awesome... thanks so much. That's exactly was I was looking for.

        Comment

        Working...