How to find the last value in ienumerable?

I use a regex pattern to find matches. Sometimes I get one match and sometimes it matches many. So, whenever it matches too many I want the last match to be assigned to another variable.

I get the following error “Object reference not set to an instance of an object” in the second assign activity.

Thanks

HI @sunilkanth

Index starts from zero so use

Regexresult(count-1).value

Please close with solution if this solves else let me know I can help

cheers

In addition to above we can also do: Regexresult.Last().Value

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.