Remove 3 elements from vtkStringArray

Is there any way to remove 3 elements from a vtkStringArray without clean up the array and load all elements except those 3 ?

And, how can I delete all elements from array without Delete method and create another one ?

I don’t see any helping method here:

Hmm… I also took a look at its iterator ( for a possible element removal method, bit it doesn’t seem to have one too. I didn’t find any way to remove elements from it without resorting to a hack (or without creating a new object). From its API it seems to be an older style container object without some of the features of present day STL containers (e.g. std::vector()) like sorting or removing individual elements.

To remove items from an array (just 3 or all of them), you can set the number of values.

If you want to update the content of an entire array at once then you can use DeepCopy.

VTK API documentation is pretty good, but if something is not clear you can check out the thousands of tests and examples and you can also find nice description of most important concepts in the VTK textbook.