Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9023949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:53:12+00:00 2026-06-16T05:53:12+00:00

I am trying to convert all list items to TitleCase. I thought TitleCase would

  • 0

I am trying to convert all list items to TitleCase. I thought TitleCase would be simple, but it does not seem to work the same as uppercase or lowercase. Any ideas? This is what works for upper and lower:

List myList = new List() { “abc”, “DEF”, “Def”, “aBC” };

myList = myList.ConvertAll(x => x.ToUpper());
myList = myList.ConvertAll(x => x.ToLower());

but neither of these work:

myList = myList.ConvertAll(x => x.ToTitleCase());
myList = myList.ConvertAll(x => x.TitleCase());
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:53:14+00:00Added an answer on June 16, 2026 at 5:53 am

    Use TextInfo.ToTitleCase method.

    List<string> myList = new List<string>() { "abc", "DEF", "Def", "aBC" };
    CultureInfo currentCulture =  System.Threading.Thread.CurrentThread.CurrentCulture;
    myList = myList.Select(r=> currentCulture.TextInfo.ToTitleCase(r.ToLower())).ToList();
    

    output:

    foreach (string str in myList)
        Console.WriteLine(str);
    

    Result:

    Abc
    Def
    Def
    Abc
    

    EDIT:

    You can use ConvetAll like:

    myList =  myList.ConvertAll(r => currentCulture.TextInfo.ToTitleCase(r.ToLower()));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to convert some simple .htaccess rewrites into web.config xml; all is well
HI all I have problem when trying to convert list collection string to one
I'm trying to implement the first example http://www.dotnetperls.com/convert-list-string into my method but I'm having
I'm trying to list all folders in sdcard via ListAdapter. But I'm getting runtime
I'm trying convert all special chars into HTML safe entities on their way into
I'm trying to convert a product table that contains all the detail of the
Basically on .show() I've been trying to have all of the inputs convert to
Trying to convert the following but am having difficulty. Can anyone see where I'm
I'm trying to set up a page where I display a list of items
I'm trying to find an efficient way to convert all ampersands in form inputs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.