equals static method

bool equals(
  1. String? lhs,
  2. String? rhs
)

Safely compares two nullable strings.

If both are null returns false If one of them is null returns false if both are the same returns true.

Implementation

static bool equals(String? lhs, String? rhs) {
  if (lhs == null && rhs == null) return true;

  if (lhs == null) return false;
  if (rhs == null) return false;
  if (!(lhs == rhs)) return false;

  return true;
}