Anonymous user
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 14:19, 22 August 2017
, 6 years agoAdded Julia language
(Added F#) |
(Added Julia language) |
||
Line 626:
Using the -r ("raw output") command-line option of jq:
<pre>g, HHH, 5, YY, ++, ///, \</pre>
=={{header|Julia}}==
<lang julia># v0.6
using IterTools
str = "gHHH5YY++///\\"
sep = map(join, groupby(x -> x, str))
println("string: $str\nseparated: ", join(sep, ", "))</lang>
{{out}}
<pre>string: gHHH5YY++///\
separated: g, HHH, 5, YY, ++, ///, \</pre>
=={{header|Kotlin}}==
|