Capitalizing words in a string using c#

前端 未结 10 1325
攒了一身酷
攒了一身酷 2020-12-16 11:22

I need to take a string, and capitalize words in it. Certain words (\"in\", \"at\", etc.), are not capitalized and are changed to lower case if encountered. The first word s

10条回答
  •  暖寄归人
    2020-12-16 12:03

    Use

    Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase("of mice and men By CNN");
    

    to convert to proper case and then you can loop through the keywords as you have mentioned.

提交回复
热议问题