String.endsWith()

Signature

boolean endsWith (String s1, String suffix)

Domain

action, condition

Description

Tests if the String s1 ends with the specified suffix.

Parameters

NameTypeDescription
s1StringA String to test for the presence of the suffix.
suffixStringA suffix String to test for in the String s1.

Returns

TypeDescription
booleantrue if s1 ends with suffix, false otherwise.

Cautions

none

Example


boolean result = String.endsWith ("This is a test", "test");

Result is:
result contains: true