Check out example codes for "c++ erase remove". It will help you in understanding the concepts better.

Code Example 1

std::vector<int> v = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; v.erase(std::remove(v.begin(), v.end(), 5), v.end()); // v will be {0 1 2 3 4 6 7 8 9}

Learn ReactJs, React Native from akashmittal.com