substring() method returns a sub-part of a string.
substring() method is overloaded.
public class Main { public static void main(String[] args) { String s1 = "Hello".substring(1); // s1 has "ello" String s2 = "Hello".substring(1, 4); // s2 has "ell" System.out.println(s1);/*from w w w .j a va2 s.c o m*/ System.out.println(s2); } }