gu******@gmail.com wrote:
hello, i would like to increment a string
I think you should ask yourself what you actually mean here.
in a for loop. The desired
output would look like:
team0
team1
team2
and so on.
OK, so do you want to:
a) Increment the ASCII code of the last character of the string, starting at '0'.
b) Increment the integer value of the last bit of the string, assuming it to be of base x, and starting at 0.
c) Append to a string, a string representation of a number, which is of base x, starting at 0, which you are able to increment, in a loop.
I would guess that you mean option c, in which case the implementation should be a bit more obvious, when expressed in that way.
Also, do you have any bounds on these numbers? What happens at these bounds?
Ben
--
I'm not just a number. To many, I'm known as a String...