Jump to content

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

→‎{{header|Perl 6}}: Add some spaces
(→‎{{header|Perl 6}}: Expanded to show unicode capabilities)
(→‎{{header|Perl 6}}: Add some spaces)
Line 227:
Note that Perl 6 works with Unicode natively and handles combiners and zero width characters correctly.
 
{{out|Output with string fffn⃗n⃗n⃗»»» ℵℵ☄☄☃☃̂☃☄☄}}
 
(For those of you with crappy browsers, thats:
{f} x 3, {Zero-width non-breaking space} x 3, {n with combining over arrow} x 3, {Space} x 2
{Right-pointing double angle quotation mark} x 3, {Alef symbol} x 2 {Comet} x 2,
{Snowman} x 1, {Snowman with combining circumflex accent} x 1, {Snowman} x 1,
{Comet} x 2
 
<pre>Orginal: fffn⃗n⃗n⃗fffn⃗n⃗n⃗»»» ℵℵ☄☄☃☃̂☃☄☄
Split: fff, , n⃗n⃗n⃗, »»», , ℵℵ, ☄☄, ☃, ☃̂, ☃, ☄☄</pre>
 
=={{header|Python}}==
10,339

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.