For padding any string with zeros at left side, you can easily use the String.format() of Java. Here is an example code.
int number = 10;
System.out.println(String.format("%05d",number));
Output will be00010
Sunday, August 7, 2011
Java: Left padding a number with zero
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment