Replace multiple string to one


#1

Hello i have a question. I want to replace multiple strings if one of them exists “FIRST”, “ANOTHER”,“SECOND” to “NEWNAME” in text document (.txt). I know how to do that with one string with regex method and replace string method, but how to add multiple pattern with OR function?


#2

Hi @sjankus,

use below code

stringvalue=stringvalue.Replace("1", string.Empty).Replace("2", string.Empty).Replace("3", string.Empty)


#3

@sjankus Try below file. It will be helpful.

ReplaceText-----.xaml (8.7 KB)


#4

Hello,

The @Manjuts90 example works perfectly!
Thank you all!