Here you can find the source of zeroPad(String encodeString, int padding)
public static String zeroPad(String encodeString, int padding)
//package com.java2s; //License from project: Apache License public class Main { public static String zeroPad(String encodeString, int padding) { try {//from w ww . ja v a 2 s.c o m int v = Integer.parseInt(encodeString); String pad = String.valueOf(v); while (pad.length() < padding) { pad = "0" + pad; } return pad; } catch (Exception e) { return encodeString; } } }