Check out example codes for "how to check the end of a string java". It will help you in understanding the concepts better.

Code Example 1

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");
       }
    }
}

Learn ReactJs, React Native from akashmittal.com