Split the string as per character

KtB-PUM+ARMATUR S.R.O., KONCERN,PRA

The above string i want to split as per comma.
and need results as below

KtB-PUM+ARMATUR S.R.O.,
KONCERN,PRA

Please note that the second word also consist of comma but it shouldn’t separate only for first comma it should separate answer next commas it should consider as a single word

Thanking you in advance!

Hi @tejas.kotharkar

System.Text.RegularExpressions.Regex.Split(YourStringVariable, "(?<=\S),")

Output is the Array of Strings On Output(0) You will get first string Output(1) You will get second

Hi @tejas.kotharkar

inputString ="KtB-PUM+ARMATUR S.R.O., KONCERN,PRA"
inputString.Split({","c}, 2)(0) 
inputString.Split({","c}, 2)(1)  

image

1 Like