Split a character string based on change of character

From Rosetta Code
Revision as of 06:24, 20 February 2021 by Drkameleon (talk | contribs) (Replaced content with "=={{header|Arturo}}== <lang rebol>parts: [] current: "" loop split {gHHH5YY++///\} 'ch [ if? or? empty? current contains? current ch -> 'current ++ ch...")

Arturo

<lang rebol>parts: [] current: "" loop split {gHHH5YY++///\} 'ch [

   if? or? empty? current
           contains? current ch -> 'current ++ ch
   else [
       'parts ++ current
       current: new ch
   ]

] 'parts ++ current print parts</lang>

Output:
g HHH 5 YY ++ /// \