json.fromList: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page Json.fromList to json.fromList: Converting page titles to lowercase)
No edit summary
Line 6: Line 6:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
json.fromList(strList)
json.fromList(strList)
</source>
</syntaxhighlight>
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
json.fromList(strList, delim)
json.fromList(strList, delim)
</source>
</syntaxhighlight>
'''Parameters'''
'''Parameters'''
{{param|strList|The [[String List]] that is converted to a [[JSON Array]].}}
{{param|strList|The [[String List]] that is converted to a [[JSON Array]].}}
Line 17: Line 17:


|example=
|example=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[r:json.fromList("a,1,g,4")]
[r:json.fromList("a,1,g,4")]
</source>
</syntaxhighlight>
Returns {{code|["a",1,"g",4]}}
Returns {{code|["a",1,"g",4]}}



Revision as of 17:49, 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

Example

[r:json.fromList("a,1,g,4")]
Returns ["a",1,"g",4]

See Also