I want to implement a functionality that auto increment an alpha numeric id in a Java program.
The ids types are Strings, have only digits and lower case latin letters, and is case insensitive.
Basically, I want a function called static String next(String id)
that gives what should be the next id.
The id should increase from right to left, and new characters should be added on the left.
For example
assertEquals("1", IdUtils.next("0"));
assertEquals("a", IdUtils.next("9"));
assertEquals("10", IdUtils.next("z"));
assertEquals("10", IdUtils.next("0z"));
assertEquals("100", IdUtils.next("zz"));
assertEquals("zz1", IdUtils.next("zz0"));
assertEquals("zza", IdUtils.next("zz9"));
Thanks in advance.