string.endsWith()

String.endsWith() Checks the string whether it ends with input string or not.
Syntax
String1.endsWith(String2)
Return value is boolean ( true or false )

Here are some examples with output.
String my_str="plus2net";
		 
System.out.println(my_str.endsWith("2net"));  // true
System.out.println(my_str.endsWith("et"));  // true
System.out.println(my_str.endsWith("t"));  // true
System.out.println(my_str.endsWith("plus2net"));  // true
System.out.println(my_str.endsWith("NET"));  // false
System.out.println(my_str.endsWith("plus2"));  // false
System.out.println(my_str.endsWith("pl"));  // false
This is case sensitive matching of end part of the string.

All String functions
Java

Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com



    Post your comments , suggestion , error , requirements etc here




    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer