Check out example codes for "remove character from string on condition c++". It will help you in understanding the concepts better.

Code Example 1

class IsChars
{
public:
    IsChars(const char* charsToRemove) : chars(charsToRemove) {};

    bool operator()(char c)
    {
        for(const char* testChar = chars; *testChar != 0; ++testChar)
        {
            if(*testChar == c) { return true; }
        }
        return false;
    }

private:
    const char* chars;
};
auto chars_to_remove = "()- ";
str.erase(std::remove_if(str.begin(), str.end(), IsChars(chars_to_remove)), str.end());

Learn ReactJs, React Native from akashmittal.com