import java.lang.*; public class StrEndWith{ public static void main(String[] args) { System.out.println("String end with example!"); String str = "Welcome to RoseIndia"; String end = "RoseIndia"; System.out.println("Given String : " + str); System.out.println("End with : " + end); if (str.endsWith(end)){ System.out.println("The given string is end with RoseIndia"); } else{ System.out.println("The given string is not end with RoseIndia"); } } }