Using RegEx to convert a collection of city names alternatively to upper and lower case using built in regex functions.
For eg if the collection has city names Bangalore, Chennai and Hyderabad, i want the output as:
BaNgAlOrE
ChEnNaI
HyDeRaBaD
using only regex functions and no character arrays
ppr
(Peter Preuss)
April 25, 2020, 8:27pm
2
@Purnima_Sambasivan
Welcome to the forum
Have a look here
2 Likes
wow… yet to understand the usages of Regex. Thank you so much ,
ppr
(Peter Preuss)
April 26, 2020, 8:51pm
4
@Purnima_Sambasivan
Unfortunately the \U \L is not supported in .Net RegEx World
But we can do it with:
Regex.Replace(strText, searchPattern, (Function (m) m.Groups(1).Value.toUpper +m.Groups(2).Value.toLower) )
Find a starter Help here
RegExReplace_ToUpperToLower.xaml (5.0 KB)
1 Like
ppr
(Peter Preuss)
April 27, 2020, 5:26pm
6
@Purnima_Sambasivan
Perfect. So when it is solved just mark the solving post as solution or let us know your open question. Other forum members can benefitfrom it. Thanks
system
(system)
Closed
April 30, 2020, 5:26pm
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.