Re:String length functions for single emoji characters evalu...
by patrickas on Friday March 26, 2021 @11:25AM
(#26593227)
Raku seems to be more correct (DWIM) in this regard than all the examples given in the post...
Edit: Updated to use the names of each code point since HN cannot display the emoji
[ Parent
| on HN ]
Re:String length functions for single emoji characters evalu...
by cjm42 on Friday March 26, 2021 @03:37PM
(#26596045)
And if you try to say emoji.length, you'll get an error:
No such method 'length' for invocant of type 'Str'. Did you mean any of these: 'codes', 'chars'?
Because as the article points out, the "length" of a string is an ambiguous concept these days.
Re:String length functions for single emoji characters evalu...
by duskwuff on Friday March 26, 2021 @12:39PM
(#26594121)
You can represent it as a sequence of escapes. If Raku handles this the same way as Perl5, it should be:
$a = "\N{FACE PALM}\N{EMOJI MODIFIER FITZPATRICK TYPE-3}\N{ZERO WIDTH JOINER}\N{MALE SIGN}\N{VARIATION SELECTOR-16}";
Re:String length functions for single emoji characters evalu...
by csharptwdec19 on Friday March 26, 2021 @01:45PM
(#26594884)
now do it in YAML