Recursive Method to Verify Alpha/Numeric Numbers

Posted 12 March 2011 - 05:51 PM

I am trying to figure out a way for the user to enter a string and then have the code recursively verify each character in the string. The user can only have 0 --> 9, a --> z, && A --> Z in the string.

I want the user to be able to enter a number all the way up to base 36 without allowing them to enter special characters in the string. So far this works, the only problem is it is not recursive and the return is based off the initialized r, instead of the r that is composed inside the loop.
I stepped through the debugger and just as I verified the string and I reached the end of the loop; just before the return, The value of r changed back to "". Instead of the right string.

I would like to know ho this could become recursive, but I need to find out why the return value gets re-initialized when leaving the loop.

WOW, I feel like an idiot... Sorry for making you guys think for nothing. I love posting and then finding the answer out myself. This is almost like asking someone to assist you in finding something, and when they start to help you, you have already found it. Anyways thanks for helping if you were going to.