Get substring For Last - Android java.lang

Android examples for java.lang:String Substring

Description

Get substring For Last

Demo Code


public class Main{

    public static String substringForLast(String str, int length) {
        if (str != null && str.length() > 0) {
            str = str.substring(0, str.length() + (length));
        }//  w  ww  . j  av  a  2 s. c  o  m
        return str;
    }

}

Related Tutorials