public class EndsWithExample
{
public static void main(String args[])
{
String s1="I Love Programming";
System.out.println("The given string is \n"+s1);
System.out.println("\nThe strings ends with g");
System.out.println("Answer = "+s1.endsWith("g"));
System.out.println("\nThe strings ends with ing");
System.out.println("Answer = "+s1.endsWith("ing"));
System.out.println("\nThe strings ends with ove");
System.out.println("Answer = "+s1.endsWith("ove"));
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.