How to convert string to InitCap

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Given any string variable in C#, how to convert the result into Initial
Capitals?

Ex: Given, "how are you?" to be converted as "How Are You?"
 
use the following method

public static string PropCase(string strText)
{
return new
CultureInfo("en").TextInfo.ToTitleCase(strText.ToLower());
}

And dont post twice any question....
 
Thanks for the reply, unfortunately, i couldn't see the post, hence is the
second time.
Will take care from the next time
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top