Deleting element of JArray in for
This question already has an answer here:
You can do this manually in a better way; when you find a "faulty" element you want to remove, you just shift all other elements to the left thus overriding the one you don't want. But I think there's no need for you to do that. (if you're adamant in this request, comment and I'll provide you with the code for doing so).
Remove()
method does that for you. Most methods for element insertion or removal from collections do work this way: they insert/delete the element at a desired position and shift other elements to the right/left respectively.
下一篇: 在for中删除JArray的元素