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

Use of req.query, req.params and req.body in NODE JS

How to capture finger prints in java