get String After Underscore - Android java.lang

Android examples for java.lang:String Algorithm

Description

get String After Underscore

Demo Code

import android.util.Patterns;
import java.util.regex.Pattern;

public class Main{

    public static String getStringAfterUnderscore(String name) {
        int indexOfLastUnderscore = name.lastIndexOf("_");
        return name.substring(indexOfLastUnderscore + 1);
    }//from  w w w . j  ava 2  s  . c o m

}

Related Tutorials