i am trying to format a string as follows
System.out.println("unique number is :"+ number[b]);
System.out.println("unique number formatted to 28 is :"+ String.format("%-28s",number[b]).replace(' ','0'))
there is no issue when "number" is a string that is shorter than 28, it adds the 0's to the left, but when the string is longer than 28 it dosnt shorten it, am i doing anything wrong ?
its an extract from a loop BTW
Many thanks