Multisplit: Difference between revisions

Content added Content deleted
(Updated to work with Nim 1.4: added missing parameter type, replaced ".. <" with "..< ".)
(Added Delphi example)
Line 520: Line 520:
{{out}} (separator locations indicated by braces):
{{out}} (separator locations indicated by braces):
<pre>a {} {} b {} {} c</pre>
<pre>a {} {} b {} {} c</pre>
=={{header|Delphi}}==
{{libheader| System.SysUtils}}
<lang Delphi>
program Multisplit;


{$APPTYPE CONSOLE}

uses
System.SysUtils;

begin
write('[');
for var s in 'a!===b=!=c'.Split(['==', '!=', '=']) do
write(s.QuotedString('"'), ' ');
write(']');
readln;
end.</lang>
{{out}}
<pre>["a" "" "b" "" "c" ]</pre>
=={{header|Elixir}}==
=={{header|Elixir}}==
{{trans|Erlang}}
{{trans|Erlang}}
Line 531: Line 549:
["a",[],"b",[],"c"]
["a",[],"b",[],"c"]
</pre>
</pre>



=={{header|F_Sharp|F#}}==
=={{header|F_Sharp|F#}}==