Split a character string based on change of character: Difference between revisions

m
→‎{{header|Perl 6}}: Grammar tweaks, add commas to multi-byte character names for readability, update works-with
(→‎{{header|Tcl}}: flagged with missing output.)
m (→‎{{header|Perl 6}}: Grammar tweaks, add commas to multi-byte character names for readability, update works-with)
Line 592:
 
=={{header|Perl 6}}==
{{works with|Rakudo|20162017.1205}}
 
<lang perl6>sub group-chars ($str) { $str.comb: / (.) $0* / }
Line 611:
</pre>
 
The second test-case is to show that Perl 6 works with strings on the Unicode grapheme level, handles whitespace, combiners, and zero width characters up to Unicode Version 9.0, and the newer multi -byte emojiEmoji characters up to Version 4.0 correctly. (Perl 6 provisionally handles Unicode Versions 10.0 and Emoji Version 5.0 but they aren't released yet so aren't officially supported.) For those of you with browsers unable to display the second string, it consists of:
* {LATIN SMALL LETTER F} x 3
* {ZERO WIDTH NO-BREAK SPACE} x 3
* {LATIN SMALL LETTER N, COMBINING RIGHT ARROW ABOVE} x 3
* {RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK} x 3
* {SPACE} x 2,
Line 620:
* {COMET} x 2,
* {SNOWMAN} x 1,
* {SNOWMAN, COMBINING CIRCUMFLEX ACCENT} x 1
* {SNOWMAN} x 1,
* {THINKING FACE} x 1
* {REGIONAL INDICATOR SYMBOL LETTER U, REGIONAL INDICATOR SYMBOL LETTER S} x 1
* {FACE PALM, ZERO WIDTH JOINER, MALE SIGN, VARIATION SELECTOR-16} x 1
* {MAN, ZERO WIDTH JOINER, WOMAN, ZERO WIDTH JOINER, GIRL, ZERO WIDTH JOINER, BOY} x 1
 
=={{header|Phix}}==
10,333

edits