albert has asked for the wisdom of the Perl Monks concerning the following question:
I have a text file which contains typographic ligatures such as "ff" and "ffi". How do I get the length as "1" for each ligature, rather than 2 for "ff" and 3 for "ffi", etc.
In preview, I see that my "ffi" is getting encoded as & #64259, so can't properly make the example. Here is my sample code formatted as tt.$char = "ffi"; $len = length($char);
$char = "ffi";
$len = length($char);
How do I get $len as 1 in this example?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Counting text with ligatures
by haukex (Archbishop) on Sep 13, 2017 at 13:46 UTC | |
by Corion (Patriarch) on Sep 13, 2017 at 13:51 UTC | |
by haukex (Archbishop) on Sep 13, 2017 at 14:02 UTC | |
Re: Counting text with ligatures
by hippo (Bishop) on Sep 13, 2017 at 14:01 UTC | |
by albert (Monk) on Sep 13, 2017 at 14:04 UTC | |
Re: Counting text with ligatures
by albert (Monk) on Sep 13, 2017 at 15:58 UTC |
Back to
Seekers of Perl Wisdom