Split a character string based on change of character: Difference between revisions
Content deleted Content added
m →{{header|Factor}}: DRY |
Walterpachl (talk | contribs) m REXX Version 2 - add REXX header |
||
Line 532: | Line 532: | ||
: splitc ( str -- str' ) [ = ] monotonic-split ", " join ; |
: splitc ( str -- str' ) [ = ] monotonic-split ", " join ; |
||
"gHHH5YY++///\\" |
"gHHH5YY++///\\" splitc print |
||
"aaabbccccdeeff" |
"aaabbccccdeeff" splitc print</lang> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 1,152: | Line 1,152: | ||
===version 2=== |
===version 2=== |
||
<lang rexx>/* REXX */ |
|||
Parse arg str /*obtain optional arguments from the CL*/ |
|||
if str=='' then str= 'gHHH5YY++///\' /*Not specified? Then use the default.*/ |
if str=='' then str= 'gHHH5YY++///\' /*Not specified? Then use the default.*/ |
||
input=str |
input=str |