Split a character string based on change of character: Difference between revisions
Split a character string based on change of character (view source)
Revision as of 12:12, 3 June 2017
, 7 years ago→{{header|Perl 6}}: Grammar tweaks, add commas to multi-byte character names for readability, update works-with
(→{{header|Tcl}}: flagged with missing output.) |
Thundergnat (talk | contribs) 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|
<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
* {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}}==
|