replaceFirst method
Finds the first occurrence of from
, and replace it with to
.
Implementation
@useCopy
IList<T> replaceFirst({required T from, required T to}) {
var index = indexOf(from);
return (index == -1) ? this : put(index, to);
}
Finds the first occurrence of from
, and replace it with to
.
@useCopy
IList<T> replaceFirst({required T from, required T to}) {
var index = indexOf(from);
return (index == -1) ? this : put(index, to);
}