J
JayEs
I have been looking at this for a while, looked up regex tutorials, perldoc
for substr, etc... and just can't come up with the answer that is probably
staring me right in the face. Maybe the matter is obfuscated by the fact
that I am really trying to do 2 things.
Here is my stupid little problem:
Given a string that can be:
"$ 12.00"
"USD 187.54"
"CAD 1.20"
"??? 12.65"
(the latter due to special characters not avail in ASCII)
How do I split these strings into 2, separating the currency code and the
value?
The only thing I know for sure is that there always is a space in the string
followed directly by a numerical (but not integer) value. Maybe I've just
been looking at it too long. Can't figure it out. Prompted me to ordering
"Learning Perl" from the online retailer whose name starts with A and ends
in mazon, but that is not very helpful right this second.
Any help would be appreciated.
JS
for substr, etc... and just can't come up with the answer that is probably
staring me right in the face. Maybe the matter is obfuscated by the fact
that I am really trying to do 2 things.
Here is my stupid little problem:
Given a string that can be:
"$ 12.00"
"USD 187.54"
"CAD 1.20"
"??? 12.65"
(the latter due to special characters not avail in ASCII)
How do I split these strings into 2, separating the currency code and the
value?
The only thing I know for sure is that there always is a space in the string
followed directly by a numerical (but not integer) value. Maybe I've just
been looking at it too long. Can't figure it out. Prompted me to ordering
"Learning Perl" from the online retailer whose name starts with A and ends
in mazon, but that is not very helpful right this second.
Any help would be appreciated.
JS