I think this code fails to operate properly because of some iteration error on my part. Please advise how I may correct this code. And, don't worry, I am not a student. I am doing this because I want to write an old fashioned text-based game. So you may help me if you like. =o)
You had it pretty good, except for a few small items. I changed your char variable, to a string and initialized it. I added in what to search for as en ending for the while loop. But I think you should also let spaces be included in the new string, otherwise, everything runs together. But then, that may be what your after. So, anyway, here is a working copy of your program. I just have the string 'str_ofAlpha' be printed once at the end.
Your solution made it function exactly as I wanted with no spaces. =o)
My overall project takes user input, converts to all lowercase, strips white space and punctuation, then compares to a string array of valid commands which, if detected and validated, will trigger a response by the program, and the process will start over again and again as the users progress though my old fashioned text-based game.
Once again, THANK YOU!
Also, thank you, newbiee999. Since whitenite's solution worked, I didn't check yours yet. But I will. So, thanks in advance.