Alternatively, use a regular expression capture.
$ perl -le ' $str = q{Price 15.40}; ( $str ) = $str =~ m{(\d+\.\d+)}; print $str;' 15.40 $
I hope this is useful.
Cheers,
JohnGG
In reply to Re: extracting number from string
by johngg
in thread extracting number from string
by samuelalfred
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |