Description

Removes the element at the specified index.

Signature

void remove(size_t index) const;

Arguments

index: the zero-based position of the element in the array.

Example

JsonArray array = doc.to<JsonArray>();
array.add("A");
array.add("B");
array.add("C");
array.remove(1);
serializeJson(array, Serial);

will print the following string to the serial output:

["A","C"]

See also