String manipulation to remove values inside the brackets

Hello All,

I have a string like “EXFU6636176(22K0),GMCU1160189(22T3),SLZU2611400,UTCU4864043(22K0),UTCU4943435(22T3)”

I wanted to remove only the brackets and values in the bracket. i can do some split function and to achieve this. but i need some one line code to do this.

thanks in advance.

Input: “EXFU6636176(22K0),GMCU1160189(22T3),SLZU2611400,UTCU4864043(22K0),UTCU4943435(22T3)”

Output:
“EXFU6636176,GMCU1160189,SLZU2611400,UTCU4864043,UTCU4943435”

image

Hi @nvignesh456 use this regex

System.Text.RegularExpressions.Regex.Replace(StringVar,“(\w*)”,“”)

image

1 Like

my expected is only to remove brackets and the values in side the brackets.

HI @nvignesh456

Welcome to UiPath community

How about this regex expression?

System.Text.RegularExpressions.Regex.Replace(YourString,“\(\d{1,3}\S\d{1,4}\)”,“”).ToString

image

Regards
Gokul

Yes , Did you try this?

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.