How would I go about deleting all '\' characters from a string?
I am using the command line to pass parameters with parenthesis, so anyone who uses my program will need to use '\(', '\), '\', etc.
lil_panda
0
Light Poster
Recommended Answers
Jump to Postjust use find() then substr() in a loop
size_t pos; while( (pos = str.find('\\')) != string::npos) { string tmp = str.substr(0,pos) + str.substr(pos+1); str = tmp; }
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.