String manipulation to convert uppercase to lowercase for some alphabets

Hey Guys,

I have a string. I need to convert some alphabets to lower case.
For example - input string : CDCKPHC-AMBTEST, MDONE (M.D.)
Output string : Cdckphc-Ambtest, Mdone (M.D.)

The logic that can be used is if any alphabet comes after a space or a special character it needs to be in uppercase. Else all alphabets will be in lower case. Also the first alphabet has to be in uppercase always.

Thanks in advance.

Hi,

How about the following?

System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(yourString.ToLower)

Regards,

1 Like

Hi @Tanmay_V_Chetule

Please find the attached Xaml File, used the regex – System.Text.RegularExpressions.Regex.Replace(inputString, “[A-Za-z]+”, Function(m) Char.ToUpper(m.Value(0)) & m.Value.Substring(1).ToLower())

Make Sure to import System.Text.RegularExpressions
The image shows a user interface listing imported namespaces in a programming environment, with "System.Text.RegularExpressions" highlighted in yellow. (Captioned by AI)


Main.xaml (7.9 KB)

1 Like