This code works but it is a bit limited so I want to remove something if it is not equal to a letter.
I know that I have to use ::isalpha instead of ::ispunct but I don't understand how to make it remove if it is not equal to :: isalpha. I have goggled this question but didn't get anywhere with the answers because I didn't understand them.
textFile[i].erase(remove_if(textFile[i].begin(), textFile[i].end(), ::ispunct), textFile[i].end());
Any Help is appreciated.