Hi,
I have value like this
“Non-capital losses at the beginning of the tax year (amount e minus amount f) . . . . . . . . . . . 102 1,000,000 1,000,000 H”
and I need only 1,000,000 from last.
If MyVar
contains your text above, assign a variable MatchColl
of type System.Text.RegularExpressions.MatchCollection
to System.Text.RegularExpressions.Regex.Matches(MyVar, "(\d+,*)+")
. This will store 3 matches: “102”, “1,000,000”, and “1,000,000”.
To get the last one, set a string variable MyVal
to MatchColl(MatchColl.Count - 1)
.
But some times if it blank, it throw error

Summary
This text will be hidden
But some times if it blank, it throw error
