Home » Tutorials » C# » Capitalize First Letter of each Words of string in C#

Capitalize First Letter of each Words of string in C#

NumberStyle in Parse() and TryParse() in C#
Difference between static and non-static variable in C#

Capitalize First Letter of each Words of string in C#

Hello folks, sometimes we may have requirement like to have Capitalize First Letter of each Words of string in C#, like we have full name of person or employee, which to be stored in database in proper manner. Ex dHruV SHeth must be stored in Database like Dhruv Sheth.

To achieve we could write our own Extension method and convert each of first latter in string. But we have ready made function in TextInfo which is ToTitleCase.

 

System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(string val);

 

 

About

Hello friends, My self Dhruv Sheth, I have more than 6 years of Industrial experience as a Software Developer. In my career I got chance to work with asp.net, c#,Web API, JavaScript, JQuery, WPF, WCF , Windows Application, PostScript, vb.net, GhostScript etc. So I have decided to share my knowledge with everyone and finally I have come up with TechnoThirsty.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*

Time limit is exhausted. Please reload CAPTCHA.




DISCLAIMER:
The content is copyrighted to technothirsty.com and may not be reproduced on other websites without permission from the owner.You may contact us using the information below.