I found this solution on Stack Overflow and other forums for removing characters from a string. Say I wanted to remove the white spaces from a string I'd do:
currentLine.erase( std::remove( currentLine.begin(), currentLine.end(), ' ' ), currentLine.end() );
where currentLine is the name of the string.
This sort of thing appears to work for people but if I use it I get:
/local/yrq12edu/Desktop/Bens_C++_Utilities/simuPOPtoFASTA/simuPOP2FASTA.cpp|54|error: cannot convert 'std::basic_string<char>::iterator {aka __gnu_cxx::__normal_iterator<char*, std::basic_string<char> >}' to 'const char*' for argument '1' to 'int remove(const char*)'|
As a compile error. I think it's something to do with the iterator that is returned by the std::remove function not working with the erase method, but apparently it should work. How do I fix this?