replace method

bool replace(
  1. T? o,
  2. T? s
)

Implementation

bool replace(T? o, T? s) {
  for (int i = 0; i < length; i++) {
    var t = this[i];
    if (t == o) {
      this[i] = s;
      return true;
    }
  }
  return false;
}