Java String Leading Character addLeadingZeros(String str)

Here you can find the source of addLeadingZeros(String str)

Description

add Leading Zeros

License

Apache License

Declaration

private static String addLeadingZeros(String str) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    private static String addLeadingZeros(String str) {
        String nStr = str;//  ww w  .  j ava  2s. c  o  m
        while (nStr.length() < 15) {
            nStr = "0" + nStr;
        }
        //Logger.debug("logTime is " + str + " => " + nStr + " length " + str.length());
        return nStr;
    }
}

Related

  1. addLeadingZeroesTo16BitBinaryString(String binaryValue)
  2. addLeadingZeros(Object number, int places)
  3. addLeadingZeros(String deweyCallNum)
  4. addLeadingZeros(String number, int maxDigits)
  5. addLeadingZeros(String s, int nZeros)
  6. addLeadingZerosToNumber(long number, int length)