I threw together a quick little program just to test/improve something I am currently working on. What this is suppose to do, when a user enters a phone number with illegal characters such as a space, (, -, etc. it will erase it from the string leaving only numbers 0-9. Every time I run it, it seems to erase values that I don't want to be erased. I tried numerous different ways, so this way might not seem the most efficient, but again I am only testing it right now.
Example of what program should do:
Enter phone number: (555) 555-5555
Return: 5555555555
You're over-complicating the checks. With newer functionality (2011+) you can do this sort of stuff quite easily. Get in to the idea of telling the compiler "what to do" vs "how to do it".
Yeah, but you see I can only use things that I have actually learned in class so half of that code is new to me and have no idea whats going on, only second semester doing computer science.
EDIT: Would there be a possible solution to fix it the way I had it on my last post w/o the use of vectors or a lamba expression?