Read extracted String beginning from right to left

Hi everyone,

unfortunately I couldn’t figure out how to read / manipulate a string, beginning from the right side. Example:

v1 = “1 kg fresh tomatos for 12,34”

Now, I’m only interested in the last part -> the price.
The chellange: the product description may vary in length, but the price always remains at the end.

Split(v1.ToString, " ",)(0)

doesn’t work

Thank you very much for your support

welcome to the forum
give a try to Regex and the Match activity:

Based on the split approach (more unreliable) following can be used:

@SebSul Modify the Split to take the last element in this way :


But this method should be used only if you’re very sure that the data may be not be empty and the data you want is always at present at the last.

1 Like

Hi @SebSul

The below regex will always give you the price which is der in the last of the statement irrespective of any length of the statement before that.


Mark as solution and like it :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

@supermanPunch: Thank you very much. Worked! I will also try the regular expression solution - but good to know that your approach also worked and furthermore: I was looking for the expression / the way to read a String backwards (also for future references).


1 Like