Live Chat Icon For mobile
Live Chat Icon

How to convert a string to Proper Case

Platform: ASP.NET| Category: Basic

Use the namespace System.Globalization

VB.NET


Dim myString As String = 'syncFusion deVeloPer sUppOrt'
’ Creates a TextInfo based on the 'en-US' culture.
Dim TI As TextInfo = New CultureInfo('en-US', False).TextInfo
Response.Write(TI.ToTitleCase(myString))

C#


string myString = 'syncFusion deVeloPer sUppOrt';
// Creates a TextInfo based on the 'en-US' culture.
TextInfo TI = new CultureInfo('en-US',false).TextInfo;
Response.Write (TI.ToTitleCase( myString ));

For more details refer TextInfo.ToTitleCase()

Share with

Share on twitter
Share on facebook
Share on linkedin