@explode(s:string, t:string)
@explode(s:string, t:tab of string)
@explode(s:string, t:tab of int)
@explode(s:string, t:funct)

Function @explode is used to split a string into a sequence of contiguous substrings.

The first form (one argument) returns a tab containing the characters of s (the characters are represented as string with only one element). For example:

                      @explode("")  -> []
                   @explode("abc")  -> ["a", "b", "c"]
       @reduce(@+, @explode("abc")) -> "abc"
         @scan(@+, @explode("abc")) -> ["a", "ab", "abc"]

The others forms (two arguments) use the second argument as a specification of delimiters in the string s and split the string accordingly in a sequence of substrings:

The string s is split in a sequence of substrings that are a partition of the first argument, i.e. the substring are non-overlaping, contiguous and non-empty. Each substring begins by a delimiter and ends before a delimiter, except for the first substring which is a prefix of s that ends just before the first delimiters and the last substrings that end with the end of s. If the resulting substring is empty, it is removed from the result.

For instance :

     "".explode(["b"]) -> []
     "a".explode(["b"]) -> ["a"]
     "ab".explode(["b"]) -> ["a", "b"]
     "abaa".explode(["b"]) -> ["a", "baa"]
     "abbb".explode(["b"]) -> ["a", "b", "b", "b"]

     @fun_def compar($x, $y) { return $x == $y }
     $a := @compar("a")

     "".explode($a) -> []
     "a".explode($a) -> ["a"]
     "ab".explode($a) -> ["ab"]
     "abb".explode($a) -> ["abb"]
     "abba".explode($a) -> ["abb", "a"]

     "abcd".explode([0, 0]) -> ["abcd"]
     "abcd".explode([0, 1]) -> ["a", "bcd"]
     "abcd".explode([1, 2]) -> ["a", "b", "cd"]
     "abcd".explode([2, 2, 2]) -> ["ab", "cd"]

Remarks that @explode(x) == @explode(x, \$a.(true)).

See also String Related Functions @car,    @cdr,    @char_is_alnum,    @char_is_alpha,    @char_is_ascii,    @char_is_blank,    @char_is_cntrl,    @char_is_digit,    @char_is_graph,    @char_is_lower,    @char_is_print,    @char_is_punct,    @char_is_space,    @char_is_upper,    @char_is_xdigit,    @copy,    @count,    @drop,    @dump,    @dumpvar,    @empty,    @explode,    @find,    @is_prefix,    @is_string,    @is_subsequence,    @is_suffix,    @last,    @member,    @occurs,    @permute,    @push_back,    @r_findall,    @r_match,    @r_search,    [@regexp],    @remove,    @remove_duplicate,    @replace,    @scramble,    @slice,    @sort,    @sputter,    @string2fun,    @stutter,    @string2proc,    @system,    @take    @to_num,    @Tracing,    @UnTracing