What is the use of startsWith and endsWith method in String java example

// What is the use of startsWith and endsWith method in String java example

public class Test {
        public static void main(String[] args) {       
            String st = new String("test string test here");
           
            System.out.println(st.startsWith("test"));
            System.out.println(st.startsWith("test", 12));
           
            System.out.println(st.endsWith("here"));
           
        }
}

Comments

Post a Comment

Recent Post

Recent Posts Widget

Popular posts from this blog

Capture image from webcam java code, examples

Shallow Copy Deep Copy Java example

Database Connection using NODE JS example