JsonArray::size()
gets the number of elements in the array pointed by the JsonArray
.
If the JsonArray
is null, this function returns 0
.
Internally, this function walks a linked-list to count the elements, so its time complexity is O(n).
Don’t use this function to create a for
loop; instead, use iterators.
JsonArray::size()
returns an unsigned integer containing the number of elements in the array.
JsonArray array = doc.to<JsonArray>();
array.add("hello");
array.add("world");
Serial.println(array.size()); // 2
See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4