Java - Padding an integer -


well, have string in java code needs converted integer padding of 10. ex. consider string... str = "52112" need convert string integer , result should "0000052112". result should integer. can me this, please?

as far know cannot have integer typed variable leading zeros. can pad number zeros become string.

take at:

http://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/stringutils.html#leftpad(java.lang.string,%20int)

in order conform signature have convert number string first, no great deal.


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -