ArduinoJson
ArduinoJson copied to clipboard
Find out the first appearance of an element in JsonArray
I have read through the API docs but didn't find such a basic functionality so I have to implement my own. A containsElement method would help:
jsonArray.containsElement<String>("third") // == 2 . find out at index 2
jsonArray.containsElement<String>("none") // == -1 . didn't find out
I think indexOf() would be a more accurate name.
You can easily implement this with a loop; no need to clutter the library.