I am trying to develop a subroutine in C # that will take a given integer and return a 6-digit alphanumeric string based on a predefined possible character set.
Possible characters to use:
"0123456789ABCDEFGHJKLMNPQRSTUVWXYZ" (note that the letters "I" and "O" are not included in the set.)
Therefore, given input 1, the output should be "000001", input 9 will output "000009", input 10 will output "00000A", input 12345 will output "000AP3", etc.
I find it difficult to find an elegant solution to this problem. I know that I must approach this uneasy, so I'm looking for some help.
Thank!
source
share