I could only do this with String, for example:
String str=\"\";
for(int i=0;i<100;i++){
str=i+str;
}
Is there a way to achieve this wit
You can use the insert method with the offset. as offset set to '0' means you are appending to the front of your StringBuilder.
StringBuilder sb = new StringBuilder();
for(int i=0;i<100;i++){
sb.insert(0,i);
}
NOTE: as the insert method accept all types of primitives, you can use for int, long, char[] etc.