Adding prefix before a character

Hello Community,
I have a trouble adding the prefix.

I have a string (mL) and mL)

I want to add a prefix \ (backslash) before the brackets.

The output i am trying to get

image

@hansen_Lobo

Please try this

Say the string in stored in str then

Str.Replace("(","\(").Replace(")","\)")

Cheers

1 Like

Hi @hansen_Lobo

Use the below workflow to add the prefix.

Check the result in below image

Hope it helps!!

1 Like

FYI, if your purpose is for regex pattern, the following works. (All special character will be escaped to be handled as literal in regex)

System.Text.RegularExpressions.Regex.Escape(yourString)
1 Like

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