public class Test {
public static void main(String[] args) {
String token = "aaaaaaaaaaaaaaa";
long startTime = System.currentTimeMillis();
for (int i = 0; i < 100; i++) {
token = strPlus(token);
}
System.out.println(token);
System.out.println((System.currentTimeMillis()-startTime));
}
public static String strPlus(String token){
char[] chars = token.toCharArray();
char start = 'a';
char end = 'z';
int length = chars.length;
for (int j = length-1; j >=0; j--) {
char f = chars[j];
char plus = ++f;
if(f>end){
chars[j] = start;
}else{
chars[j] = plus;
break;
}
}
return new String(chars);
}
}