-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3678 from nirvn/string_to_array_to_string
[FEATURE] add string_to_array() and array_to_string() functions
- Loading branch information
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "array_to_string", | ||
"type": "function", | ||
"description": "Concatenates array elements into a string separated by a delimiter using and optional string for empty values.", | ||
"arguments": [ | ||
{"arg":"array", "description":"the input array"}, | ||
{"arg":"delimiter","optional":true,"default":"','","description":"the string delimiter used to separate concatenated array elements"}, | ||
{"arg":"emptyvalue","optional":true,"default":"''","description":"the optional string to use as replacement to empty values"}], | ||
"examples": [ { "expression":"array_to_string(array('1','2','3'),',')", "returns":"'1,2,3'"}, | ||
{ "expression":"array_to_string(array('1','','3'),',','0')", "returns":"'1,0,3'"} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "string_to_array", | ||
"type": "function", | ||
"description": "Splits string into an array using supplied delimiter and optional string for empty values.", | ||
"arguments": [ | ||
{"arg":"string", "description":"the input string"}, | ||
{"arg":"delimiter","optional":true,"default":"','","description":"the string delimiter used to split the input string"}, | ||
{"arg":"emptyvalue","optional":true,"default":"''","description":"the optional string to use as replacement to empty values"}], | ||
"examples": [ { "expression":"string_to_array('1,2,3',',')", "returns":"array: '1', '2', '3'"}, | ||
{ "expression":"string_to_array('1,,3',',','0')", "returns":"array: '1', '0', '3'"} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters