Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to uppercase the first character of each word using a regex in VB.NET?

Tags:

regex

vb.net

ssis

Is it possible to uppercase the first character of each word using regex?

I'm going to be using this in VB.net (SSIS)

like image 800
Jeremy Avatar asked Nov 03 '09 15:11

Jeremy


People also ask

How do we Capitalise the first character of every word in a string?

To capitalize the first character of a string, We can use the charAt() to separate the first character and then use the toUpperCase() function to capitalize it. Now, we would get the remaining characters of the string using the slice() function.

How do you capitalize the first letter of a word?

To use a keyboard shortcut to change between lowercase, UPPERCASE, and Capitalize Each Word, select the text and press SHIFT + F3 until the case you want is applied.


1 Answers

Why not just use the inbuilt TextInfo.ToTitleCase() method already in the .NET Framework?

string capitalized = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase("this string should be capitalized!");
like image 110
Dan Diplo Avatar answered Oct 26 '22 02:10

Dan Diplo