Answers for "how to check the end of a string java"

0

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");
       }
    }
}
Posted by: Guest on July-04-2020

Code answers related to "how to check the end of a string java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language