IF a string may include several un-necessary elements, e.g., such as @, #, $,%.
How to find them and delete them?
I know this requires a loop iteration, but I do not know how to represent sth such as @, #, $,%.
If you can give me a code example, then I will be really appreciated.
The usual standard C++ approach would be the erase/remove idiom:
and yes, boost offers some neat ways to write it shorter, for example using boost::erase_all_regex