I’m trying to remove everything in a sentence that comes before a certain word. Problem is it’s random except for the word I’m trying to keep. Example: “Hello World 403 !It’s Me IMPORTANT” and I want to keep only IMPORTANT.
You can use Regex to achieve this! Try using this link to preview/play with the result.
In UiPath Studio - use an Assign activity like this.
Str_Variable = System.Text.RegularExpressions.Regex.Replace(YOURINPUTSTRING, “[\s\S]*(?=IMPORTANT)”, “”)
GIve it a go
Works flawlessly, thanks!
If you want to match only text on the same line prior to “IMPORTANT” then you could use:
Thanks a lot, I’ll keep that in mind
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.