public static String addZerosBefore ( String orderNo , int count ) { if ( orderNo == null ) { return "" ; // orderNo = ""; } if ( orderNo . length ( ) > count ) { orderNo = "?" + orderNo . substring ( orderNo . length ( ) - count - 1 , orderNo . length ( ) - 1 ) ; } else { int le = orderNo . length ( ) ; for ( int i = 0 ; i < count - le ; i ++ ) { orderNo = "0" + orderNo ; } } return orderNo ; }
Method addZerosBefore .