explode

ldmud-3.3.719/doc/efun/explode · 1.0 KB

From the archive ldmud-3.3.719.tar.gz

Download the archive   « Back to the archive contents

SYNOPSIS
        string *explode(string str, string del)

DESCRIPTION
        Return an array of strings, created when the string str is split
        into substrings as divided by del.

        implode(explode(str, del), del) == str is always true.

EXAMPLES
        function                    returns
        -------------------------------------------------------------------
        explode(" ab cd ef ", " ")  ({ "", "ab", "cd", "ef", "" })
        explode("abc", "abc")       ({ "", "" })
        explode("", "")             ({})
        explode("abc", "xyz")       ({ "abc" })
        explode("abc", "")          ({ "a", "b", "c" })

HISTORY
        Date of change is unknown.
        explode(" ab cd ef ", " ") formerly returned ({ "ab", "cd", "ef" })
        instead of ({ "", "ab", "cd", "ef", "" }), i. e. the empty strings
        were ignored. The new behaviour is more consistent, because now
        implode(explode(str, del), del) == str is always true.

SEE ALSO
        sscanf(E), extract(E), implode(E), regexplode(E)

Site Stats

Snippets: 1791
Codebases: 571