Create substring from variable, selecting everything after specific string

Hey guys I have a variable ‘Screen_Capture_All’ and I want to take all the text after ‘low to high’ and apply the output to ‘Screen_Capture_All’, or to a place holder variable and then just apply that to Screen_Capture_All.

How do I create a substring (or equivalent) from ‘Screen_Capture_All’ where it will output all the text after ‘low to high’? Also the value of ‘Screen_Capture_All’ may be slightly different each time I run the bot. And is there a package that contains all the string related functions in it as activity devices? Thanks.

Hi,

You can get it using Regular Expression.
For example,the following sentence return after “low to high”.

System.Text.RegularExpressions.Regex.Match(s,"(?<=low to high)[\s\S]*").ToString

Regards,

1 Like

Is there an easier way to do this? Are there any packages that have the string functions made into activities in them?

Hi,

There is Matches Activity which provide Regular Expression matches function, but it also requires knowledge of Regex.

Another solution is to use Strings.Split method as the following.

Strings.Split(data,"low to high")(1)

Or you might be able to find more useful package in UiPath Go!

Regards,

Thanks Yoichi, yea Regex is not a problem I just don’t know any of the .net type string functions.