Skip to content
JsonArray

Swap

void Swap(const std::size_t a, const std::size_t b)

Will swap two indicies. That's it.


Example:

We have this json in our array:
[
    "Red Bull",
    "Monster Energy",
    "Rockstar",
    "Coca Cola"
]
C++:
myJsonArray.Swap(0, 2);
Result:
[
    "Rockstar",
    "Monster Energy",
    "Red Bull",
    "Coca Cola"
]