Increment an index that uses numbers and characters

Posted by Martin on Stack Overflow See other posts from Stack Overflow or by Martin
Published on 2011-01-03T17:39:02Z Indexed on 2011/01/03 17:53 UTC
Read the original article Hit count: 158

Filed under:

I have a string based code that can be either two or three characters in length and I am looking for some help in creating a function that will increment it.

Each 'digit' of the code has a value of 0 to 9 and A to Z.

some examples:

the first code in the sequence is 000

009 - next code is - 00A
00D - next code is - 00E
AAZ - next code is - AB0

the last code is ZZZ.

Hope this makes some sense.

© Stack Overflow or respective owner

Related posts about c#