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.

[227 byte] By [SLDykea] at [2007-11-27 10:44:45]
# 1

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

jverda at 2007-7-28 20:08:44 > top of Java-index,Java Essentials,New To Java...
# 2

scratch that

Message was edited by:

petes1234

petes1234a at 2007-7-28 20:08:44 > top of Java-index,Java Essentials,New To Java...