json.fromList: Difference between revisions
Jump to navigation
Jump to search
Verisimilar (talk | contribs) m (Correcting JSON Array link.) |
No edit summary |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 3: | Line 3: | ||
|version=1.3b49 | |version=1.3b49 | ||
|description= | |description= | ||
Returns a [[JSON Array]] from a [[String List]]. | |||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
json.fromList(strList) | |||
</ | </syntaxhighlight> | ||
<syntaxhighlight lang="mtmacro" line> | |||
json.fromList(strList, delim) | |||
</syntaxhighlight> | |||
'''Parameters''' | |||
{{param|strList|The [[String List]] that is converted to a [[JSON Array]].}} | |||
{{param|delim|The delimiter used in the [[String List]], defaults to {{code|","}}.}} | |||
|example= | |example= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[r:json.fromList("a,1,g,4")] | [r:json.fromList("a,1,g,4")] | ||
</ | </syntaxhighlight> | ||
Returns {{code|["a",1,"g",4]}} | |||
|also= | |||
{{func|json.toList}} | |||
}} | }} | ||
[[Category:JSON Function]] | [[Category:JSON Function]] |
Latest revision as of 23:59, 15 March 2023
json.fromList() Function
• Introduced in version 1.3b49
Returns a JSON Array from a String List.
Usage
json.fromList(strList)
json.fromList(strList, delim)
Parameters
strList
- The String List that is converted to a JSON Array.delim
- The delimiter used in the String List, defaults to","
.
Example
[r:json.fromList("a,1,g,4")]
["a",1,"g",4]