String endsWith() Method

String endsWith() Method in Java with Example

The Java endsWith method is used to check whether the string is ending with user-specified substring or not. Based on this comparison it will return boolean True or False.

Syntax

Output:

EndsWith character ‘e’: true
EndsWith character ‘ple’: true
EndsWith character ‘Java’: false

The java.lang.String.endsWith() returns true if this string ends with the specified suffix.

top
X
Welcome to Our Website
Welcome to WPBot
wpChatIcon