juo has asked for the wisdom of the Perl Monks concerning the following question:
I noticed when using substract it cannot work to extract the last character if that last character is a special symbol. For example (microns,ohm,...) Ù If I have a string like : 24Ù and I want to get the unit of that string and use :
my $ohm = '24Ù'; $unit = substr $ohm, -1; print "$unit\n"; # This will return a ? in my CMD be aware that you c +annot see the Ohm character
Does anybody have any idea how to resolve this. I noticed in a previous post state that we could use the Hex code to do things like this (\x{00A1}) but does anybody has any idea how to get the HEX code for a given special symbol? I found Unibook rather difficult to get the right code, as it is looking in a labyrinth for the right one.
Retitled by davido from 'Substract cannot extract last special character'.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Substr cannot extract last special character
by Samy_rio (Vicar) on Aug 19, 2005 at 03:54 UTC | |
by Samy_rio (Vicar) on Aug 19, 2005 at 05:59 UTC | |
|
Re: Substr cannot extract last special character
by newroz (Monk) on Aug 19, 2005 at 08:09 UTC | |
by dave_the_m (Monsignor) on Aug 19, 2005 at 10:45 UTC |