equals method

bool equals(
  1. String comparison
)

Checks if this string is exactly equal to another string.

Performs a direct string comparison between this string and comparison. This comparison is case-sensitive.

Returns true if the strings are identical, otherwise returns false.

Example:

'hello'.equals('hello'); // true
'Hello'.equals('hello'); // false (case-sensitive)
'hello'.equals('world'); // false

Implementation

bool equals(String comparison) {
  return _equals(this, comparison);
}