Padding a String
How do I pad a string on the left with zeros to make in a specific length. I am doing a calculation on a dash number(-005) to determine the next dash. The calculation result is 7 so I need to pad 00 to the left of the 7.
How do I pad a string on the left with zeros to make in a specific length. I am doing a calculation on a dash number(-005) to determine the next dash. The calculation result is 7 so I need to pad 00 to the left of the 7.
http://java.sun.com/docs/books/tutorial/i18n/format/index.html
http://java.sun.com/j2se/1.5.0/docs/api/java/io/PrintWriter.html#printf(java.lang.String, java.lang.Object...)
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Formatter.html#syntax