String.equals()

Description

Compares two Strings for equality. The comparison is case-sensitive, meaning the String "hello" is not equal to the String "HELLO".

Syntax

myString.equals(myString2)

Parameter Values

  • myString, myString2: variables of type String.

Return Values

  • true: If string equals string2.
  • false: Otherwise.

See Also

Please note: These are affiliate links. If you buy the components through these links, We may get a commission at no extra cost to you. We appreciate it.