String.equals()

Signature

boolean equals (String s1, String s2)

Domain

action, condition

Description

Compares two Strings and returns a boolean indicating whether they are equal.

Parameters

NameTypeDescription
s1StringA String to compare.
s2StringA second String to compare.

Returns

TypeDescription
booleantrue if the Strings are equal, otherwise returns false.

Cautions

none

Example


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

Result is:
result contains: false