Skip to content
Snippets Groups Projects
Commit 465041f1 authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

explode/implode now simulated

Rev: doc/simulated/explode:1.1
Rev: doc/simulated/implode:1.1
parent 69218f9c
No related branches found
No related tags found
No related merge requests found
NAME
explode - explode a string on a delimeter
SYNTAX
string *explode(string victim, string delimeter);
or
victim / delimiter
DESCRIPTION
Explode divides the string called victim at every occurance of
the string delimeter and returns the resulting parts in an array.
If delimeter is an empty string, victim will be divided into strings
of length 1.
EXAMPLES
> explode("foobar","o");
Result: ({ "f", "", "bar" })
> explode("10101001010100010101","10");
Result: ({ "", "", "", "0", "", "", "00", "", "1" })
> explode("/foo/bar/gazonk","/");
Result: ({ "", "foo", "bar", "gazonk" })
> explode("foobar","");
Result: ({ "f", "o", "o", "b", "a", "r" })
KEYWORDS
string
SEE ALSO
implode
NAME
implode - implode an array of strings
SYNTAX
string implode(string *a, string delimeter);
or
a * delimeter
DESCRIPTION
This function is the inverse of explode. It contatenates all the
strings in a with a delimeter in between each. If no delimeter is
given, an empty string will be used.
EXAMPLES
> implode( ({ "foo","bar","gazonk"}), "-" );
Result: foo-bar-gazonk
> implode( ({ "f","o","o" }) );
Result: foo
> ({ "a","b","c" })*" and ";
Result: a and b and c
>
KEYWORDS
string
SEE ALSO
explode
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment