How to replace some special character

Hello, I have a bunch of emails that has this specific numbers & characters in it (eg: SR/20241221/0123).

These emails are then required to store in a shared platform on the internet. Thus, I have to download the bunch of email into my Download Folder. When I download these emails, the characters mentioned above changed (eg: From this SR/20241221/0123 it becomes this SR_20241221_0123).

I used regex to identify this SR/20241221/0123 but how do I convert the characters from “/” to “_”?

Hi,

Can you elaborate?
How about using String.Replace simply, as the following?

yourString.Replace("/","_")

Regards,

1 Like

Hi @mnurhaikal

By using Regex

System.Text.RegularExpressions.Regex.Replace(Input,"/","_")

Regards,