+substring(beginIndex: int) return type string
import java.lang.String;
class subStringstart{
public static void main(String[] arg){
String str1="Welcome to Java";
String str2=str1.substring(3);
System.out.println("str1: "+str1);
System.out.println("str2=str1.substring(3): "+str2);
}
}
OutPut : str1: Welcome to Java
str2=str1.substring(3): come to Java
class subStringstart{
public static void main(String[] arg){
String str1="Welcome to Java";
String str2=str1.substring(3);
System.out.println("str1: "+str1);
System.out.println("str2=str1.substring(3): "+str2);
}
}
OutPut : str1: Welcome to Java
str2=str1.substring(3): come to Java