2013年11月4日 星期一

java-padR

java padRight

add zero on right side


public static String padR(String s, int n,char t) {
return String.format("%1$-" + n + "s", s).substring(0, n).replace(' ', t);
}


noRecordBatch=padR(noRecordBatch,5, '0');   //60000

沒有留言:

張貼留言