Keep string after a certain word

The String looks like this:

Showing rows 1 - 2 of 2

I only want to keep the number 2 after the word “of”.
Can you help me with an expression to get the expected result.

Thanks

grafik

2 Likes

Hi @atomic ,

Try this code

"Showing rows 1 - 2 of 2".Split(new string(){"of"}, StringSplitOptions.None)(1).ToString.Trim

1 Like

@ppr im not used to work with regular expressions. Which of the activities should I use to get the Output “2” in this case.

I can choose from “Replace”, “Matches” and the “Is Match” activity.

And what should the parameters contain?

@aanandsanraj works great, thanks!

2 Likes