Skip to content

Add a Python-like slice operator for lists and stringsΒ #983

Open
@justinfagnani

Description

@justinfagnani

String.substring() and List.getRange() are somewhat verbose, but very common operations. Python's slice operator provides an easy-to-read notation to replace these.

Examples of substring() and slice [:]

string.substring(a) -> string[a:]

string.substring(a, b) -> string[a:b]

string.substring(0, a) -> string[:a]

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).core-mtype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions