What is different type of substring method in String java example
What is different type of substring method in String java example
public class Test {
public static void main(String[] args) {
String st = new String("Test String Here");
String st1 = new String("test string test here");
String st2 = st.substring(5);
System.out.println(st2);
st2 = st.substring(0, 11);
System.out.println(st2);
st2 = st.substring(5, 11);
System.out.println(st2);
}
}
public class Test {
public static void main(String[] args) {
String st = new String("Test String Here");
String st1 = new String("test string test here");
String st2 = st.substring(5);
System.out.println(st2);
st2 = st.substring(0, 11);
System.out.println(st2);
st2 = st.substring(5, 11);
System.out.println(st2);
}
}
Comments
Post a Comment