Split a character string based on change of character: Difference between revisions
Content deleted Content added
m added a related task. |
|||
Line 1,368: | Line 1,368: | ||
=={{header|PicoLisp}}== |
=={{header|PicoLisp}}== |
||
{{incorrect|PicoLisp|<br><br>The output character string isn't correct,<br>it should split the input character string and show the string:<br><br><big>g, HHH, 5, YY, ++, ///, \</big><br><br>not<br><br><big>(("g") ("H" "H" "H") ("5") ("Y" "Y") ("+" "+") ("/" "/" "/") ("\\"))</big><br><br>}} |
|||
<lang PicoLisp>(de splitme (Str) |
<lang PicoLisp>(de splitme (Str) |
||
(let (Str (chop Str) Fin) |
(let (Str (chop Str) Fin) |
||
( |
(glue |
||
", " |
|||
(make |
|||
(for X Str |
|||
( |
(if (= X (car Fin)) |
||
(conc Fin (cons X)) |
|||
⚫ | |||
(link (setq Fin (cons X))) ) ) ) ) ) ) |
|||
⚫ | |||
{{out}} |
{{out}} |
||
<pre>g, HHH, 5, YY, ++, ///, \</pre> |
|||
<pre> |
|||
(("g") ("H" "H" "H") ("5") ("Y" "Y") ("+" "+") ("/" "/" "/") ("\\")) |
|||
</pre> |
|||
=={{header|Pike}}== |
=={{header|Pike}}== |