JsonDataObjects icon indicating copy to clipboard operation
JsonDataObjects copied to clipboard

How to swap elements in array

Open JamesInform opened this issue 5 years ago • 0 comments

Hi Andreas

First of all, thanks for providing such a great JSON library.

I am having a json array which I want to sort using bubble sort. To do so I need to swap elements in the array, e.g. swap the 5th element with the 2nd.

What is the easiest way to do so? Would be very nice, if I could just swap elements without knowing what json type a specific element has.

If swapping is not possible, could you implement a swap function for the TJsonArray type?

Cheers James

JamesInform avatar Aug 10 '20 23:08 JamesInform