I need to extract a substring of varying length from strings of varying lengths. I know this sounds confusing so I'll post a few examples...
"This is a short string with a small price - $1.25"
"This is a somewhat longer string that happens to end with a greater price - $12.45"
"And this is just another string with a large price at the end - $1200.35"
Somehow I need to extract just the number from each string (including the decimal point, but without the "$").
The number I need is always at the end of the string but the range is 0.01 to 9999.99
In the end, I will be adding these numbers together, then displaying the total as a dollar amount.
Is this even possible? Can the "$" be used as the starting point (+1) of the substring? Can this be extracted right to left, stopping at the "$" somehow?
Can someone provide a snippet if this isn't too complicated? Or maybe just point me in the right direction?