Java String Value Of valueOfString(String str, int len)

Here you can find the source of valueOfString(String str, int len)

Description

value Of String

License

Open Source License

Declaration

private static String valueOfString(String str, int len) 

Method Source Code

//package com.java2s;

public class Main {
    private static String valueOfString(String str, int len) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < len - str.length(); i++) {
            sb.append("0");
        }//from w  w w. j a  v  a 2 s . c o  m
        return (sb.length() == 0) ? (str) : (sb.toString() + str);
    }
}

Related

  1. valueOfInteger(final String s, int radix)
  2. valueOfIpv4(String ip)
  3. valueOfLongToString(long[] values)
  4. valueOfNullSafe(final Class enumType, final String name)
  5. valueOfOrEmptyString(final Object object)
  6. ValueOfString(String value)
  7. valueOfStringToLong(String[] values)
  8. valueOfYesNo(String parameter)