json.length: Difference between revisions
Jump to navigation
Jump to search
m (Conversion script moved page Json.length to json.length: Converting page titles to lowercase) |
No edit summary |
||
Line 6: | Line 6: | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[h: len = json.length(jobj)] | [h: len = json.length(jobj)] | ||
[h: len = json.length(jarr)] | [h: len = json.length(jarr)] | ||
</ | </syntaxhighlight> | ||
|example= | |example= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[h:a=json.fromStrProp("a=1;b=44;c=12")] [json.length(a)] | [h:a=json.fromStrProp("a=1;b=44;c=12")] [json.length(a)] | ||
[h:a=json.fromList("a,1,g,4")][json.length(a)] | [h:a=json.fromList("a,1,g,4")][json.length(a)] | ||
</ | </syntaxhighlight> | ||
Returns | Returns |
Revision as of 17:40, 15 March 2023
json.length() Function
• Introduced in version 1.3b49
Returns the number of fields in a json object or number of elements in a json array.
Usage
[h: len = json.length(jobj)]
[h: len = json.length(jarr)]
Example
[h:a=json.fromStrProp("a=1;b=44;c=12")] [json.length(a)]
[h:a=json.fromList("a,1,g,4")][json.length(a)]
Returns
3 4