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

Content deleted Content added
Peak (talk | contribs)
jq
Peak (talk | contribs)
→‎{{header|jq}}: using the -r option
Line 613: Line 613:
| join(sep) ;
| join(sep) ;


"aabbcc" | splitAtChange(", ")</lang>
"gHHH5YY++///\\" | splitAtChange(", ")</lang>
{{out}}
{{out}}
Using the -r ("raw output") option of jq:
<pre>"aa, bb, cc"</pre>
<pre>g, HHH, 5, YY, ++, ///, \</pre>



=={{header|Kotlin}}==
=={{header|Kotlin}}==