Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to check the end of a string java

public class Demo {
    public static void main(String[] args) {
       String str = "demo";
       if(str.endsWith("mo")) {
          System.out.println("The string ends with the word mo");
       } else {
          System.out.println("The string does not end with the word mo");
       }
    }
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #check #string #java
ADD COMMENT
Topic
Name
3+2 =