pad string from Right - Android java.lang

Android examples for java.lang:String Pad

Description

pad string from Right

Demo Code

public class Main{

    public static String padRight(String s, int n) {
        return String.format("%1$-" + n + "s", s);
    }/*from  w w  w. j a  v  a 2  s.c o m*/

}

Related Tutorials