Background: Palindrome checker that takes input string and removes any whitespaces and characters that are not alphabets or numbers. It then converts the resultant string to lowercase throughout using transform() and then reverses this string using rbegin(), rend() before doing palindrome checks
Problem: code works fine except for removing the single apostrophe as seen in words like don't, can't
Code: I am using Dev-C++ 5.11 and have tried turning off 'Complete Single Quotes' under 'Symbol Completion' in 'Editor Settings' but that doesn't help. I am getting "missing terminating ' character" error for the following code:
Code:
string str;
str.erase(remove(str.begin(), str.end(), ' ' '), str.end());
It seems the compiler expects the apostrophe characters in pairs. I am not posting the full code but just the bit relating to this particular issue.
Any suggestions, as always, would be most welcome. Thanks