Question : Computing next id in base 36

Hi,

I have an identifier containing two characters (String) in base 36 : the id contains numbers from 0 to 9 and letters from A to Z (uppercase). Exception on 0 and 00 which are forbidden.

I need a method which gives me the next id in base 36.

Thank you

Answer : Computing next id in base 36

you can specify the base to use when calling parseInt()

http://helpdesk.objects.com.au/java/how-to-parse-a-hex-string

So parse it, add one, then convertit back to a base36 string

String s = Integer.toString(n, 32);

 http://java.sun.com/javase/6/docs/api/java/lang/Integer.html#toString(int,%20int)
Random Solutions  
 
programming4us programming4us