All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jamel.dbf.utils.StringUtils Maven / Gradle / Ivy

There is a newer version: 0.3.0
Show newest version
package org.jamel.dbf.utils;

/**
 * @author Sergey Polovko
 */
public class StringUtils {

    public static String rightPad(String str, int size, char padChar) {
        // returns original string when possible
        if (str.length() >= size) return str;

        StringBuilder sb = new StringBuilder(size + 1).append(str);
        while (sb.length() < size) {
            sb.append(padChar);
        }
        return sb.toString();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy