Can java.lang.String.format(String str, String str1) be used for adding prefix of a particular character.
java.lang.String.format(String str, String str1)
I could do this for a number like:
You can't use String.format() for padding with arbitrary characters. Perhaps Apache Commons StringUtils.leftPad() would be of use for a concise solution ? Note there's also a StringUtils.rightPad() too.
String.format()
StringUtils.rightPad()