I am trying to add number '0' to numbers less than 10
For example instead of '9', output is supposed to be '09'
I have tried this but it still outputs '0' for number > 10 :
System.out.println("0" + message.substring(i, Math.min(i + framel, message.length())).length() +
"-" + message.substring(i, Math.min(i + framel, message.length())));
I also tried this (length < 10 ? "0" : ""):
System.out.println((length < 10 ? "0" : "") + message.substring(i, Math.min(i + framel, message.length())).length() +
"-" + message.substring(i, Math.min(i + framel, message.length())));