Remove string occuring multiple times

Hi All,

I need to remove the highlighted text/string from text file which is occurring multiple times.
Stating from “Page” to “”.

I tried using index of both and used remove option ,however it is deleting only the first part of the string where it is present,for other parts where the same string is present how to remove.

Any way i can remove in one go or iteration thru loop somehow.

You can use there replace
YourString.tostring.replace(“Enter your all string who you want to remove”," ")

Thanks & Regards
Bagish Ojha

@bagishojha page “2” of 4 ,no is changing.

show me your code or screenshot

I’m using string.remove(string.IndexOf(“Page”),string.indexof(“page”)+200)

this is removing the string on its first occurrence,but not all the occurrence.

Hi @prateekjain1992

Try this:

Click here to see it in action.

You can use Replace activity, but make sure the Single Line option is selected:

1 Like

hi @loginerror ,

thanks for the help,the regex is working fine when I am testing on regextester.

However in uipath it is not able to find,i have selected all three options in regexoption.

Can you help on this.


Indeed, the issue was with the $ character. It will work when you remove it, see example: (1.9 KB)

Thanks,it worked.