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'.
In reply to Substr cannot extract last special character by juo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |