blob: 7f0b3b52ee78ad2fe449ec3efa0ab64bd0e99885 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstra715ec202025-07-09 22:18:31 +02002 string implode(string *arr, string del)
3 bytes implode(bytes *arr, bytes del)
MG Mud User88f12472016-06-24 23:31:02 +02004
Zesstra715ec202025-07-09 22:18:31 +02005DESCRIPTION
6 Concatenate all strings found in array arr, with the string
7 del between each element. Only strings are used from the array.
8 Works similar with arrays of byte sequences.
MG Mud User88f12472016-06-24 23:31:02 +02009
Zesstra715ec202025-07-09 22:18:31 +020010EXAMPLES
11 function returns
MG Mud User88f12472016-06-24 23:31:02 +020012 -------------------------------------------------------------------
Zesstra715ec202025-07-09 22:18:31 +020013 implode(({ "foo", "bar", "" }), "*") "foo*bar*"
14 implode(({ "a", 2, this_object(), "c" }), "b") "abc"
MG Mud User88f12472016-06-24 23:31:02 +020015
Zesstra715ec202025-07-09 22:18:31 +020016 Together with explode() this can be used as a search and replace
17 function of strings:
MG Mud User88f12472016-06-24 23:31:02 +020018 implode(explode("a short text", " "), "_") "a_short_text"
19
Zesstra715ec202025-07-09 22:18:31 +020020 But nowadays you can also use
21 regreplace("a short text", " ", "_", 1)
22 instead.
MG Mud User88f12472016-06-24 23:31:02 +020023
Zesstra715ec202025-07-09 22:18:31 +020024SEE ALSO
Zesstrad59c3892019-11-28 20:53:39 +010025 explode(E), regreplace(E)