How replace a special characters in string


Im new to RPA automation. Im having requirement where I need to remove all the special character.

Ex :

I have a string called “thisIs@myQuestion#”, I want to replace all the special character and return result as “thisIsmyQuestion”

Thanks for all your help!!


Hi @Kavya_Bhat ,

From what i understand, you need to remove the special character from a string.

Try using Regex.

System.Text.RegularExpressions.Regex.Replace(“thisIs@myQues#”, “[^a-z A-Z]”, “”).ToString

Let me know if it works.

1 Like


you can get that text by using RegEx.

Please follow the bellow

1.Store the string into a variable called RegEx.
2. now use like below



1 Like


Thank you so much for replying so fast and helping. When I tried as told. I faced below error.

Hi @pavithra_pavi ,

Thank you so much for replying so fast. This is what I was looking for. I was able to remove the special character.

Thanks again :slight_smile: :grin:

1 Like

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