I’d like to convert integers from decimal base to quaternal base. What is the more concise way to do it ?
// From 4-base to decimal
int d = Integer.parseInt("10", 4); // 5
// From decimal to decimal string
String b10 = String.valueOf(d); // "5"
// From decimal to 4-base string ?
String b4 = yourMagicFunction(d, 4); // "10"
Are you just looking for
Integer.toString(int, int)?(Note the 11 rather than 10… parsing “10” base 4 gives 4, not 5.)
It’s not clear what you’re looking for beyond
Integer.parseInt(String, int)andInteger.toString(int, int)…