Add slice/slice-assignment operators. #8977
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
closed-duplicate
Closed in favor of an existing report
type-enhancement
A request for a change that isn't a bug
A lot of library operations on strings and lists would be more easily expressed using a Python (etc.) like "slice operator".
T operator [:]({int start, int end});
void operator[:]=(var value, {int start, int end});
This would replace String.substring with [:], make it easy to add List.subList/replace List.getRange with [:], use [:]= to replace insertRange.
Both parameters are optional, and usually default to start = 0 and end = length of sequence if omitted.
The text was updated successfully, but these errors were encountered: