json.toList: Difference between revisions

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


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: jarr = json.toList(jarr)]
[h: jarr = json.toList(jarr)]
[h: jarr = json.toList(jarr, delim)]
[h: jarr = json.toList(jarr, delim)]
</source>
</syntaxhighlight>


'''Parameters'''
'''Parameters'''
Line 16: Line 16:


|examples=
|examples=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
   [h:a=json.fromList("a,1,g,4")]
   [h:a=json.fromList("a,1,g,4")]
   [json.toList(a)]
   [json.toList(a)]
</source>
</syntaxhighlight>


Returns
Returns
<source lang="mtmacro">
<syntaxhighlight lang="mtmacro">
     a,1,g,4
     a,1,g,4
</source>
</syntaxhighlight>


}}
}}
[[Category:JSON Function]]
[[Category:JSON Function]]

Revision as of 17:38, 15 March 2023

json.toList() Function

Introduced in version 1.3b49
Creates a string list from a JSON Array. If the delimiter is not specified then the default value of ',' is used.

Usage

[h: jarr = json.toList(jarr)]
[h: jarr = json.toList(jarr, delim)]

Parameters

  • jarr - JSON Array
  • delim - Delimiter used in output

Examples

  [h:a=json.fromList("a,1,g,4")]
  [json.toList(a)]

Returns

     a,1,g,4