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:
This is how I solved this issue using the base jdks String.format function
String sendId="AABB"; int length=20; String.format("%"+length+"s",sendId).replaceAll(" ","0")