Incrementing alpha characters. Base36
Afternoon all,
Came upon a problem needed at work where i'm having some trouble programming the solution. They are looking for a simple program which takes entry of a 6 digit "number" as a START number, then another 6 digit "number" as an ending number. The program needs to generate the numbers inbetween (inclusive of the start and end).
For example:
Start 100000
End 100011
would generate:
100000
100001
100002
100003
100004
100005
100006
100007
100008
100009
100010
100011
I wrote this without any problems several months ago. The trouble now is, they specifications have changed. The last 4 digits of the 6 digit number now will no longer be base10, but base 36. So for example:
Start: 100000
End: 100011
Needs to generate:
would generate:
100000
100001
100002
100003
100004
100005
100006
100007
100008
100009
10000A
10000B
10000C
...
10000X
10000Z
100010
100011
I'm having trouble on how to accomplish this. My first though was to handle each of the last 4 characters individually, increment the ones digit from 0-Z, then increment the tens digit and so on, however, that seems very not efficient.
So, any advice would be terrific. Thanks in advance.