Skip to content

proposal: bytes,strings: add LastIndexRune #75663

@gqgs

Description

@gqgs

Proposal Details

Currently these are the functions that currently exist for the Index operation

Index(s, substr string) int
IndexAny(s, chars string) int
IndexByte(s string, c byte) int
IndexFunc(s string, f func(rune) bool) int
IndexRune(s string, r rune) int

And these are the operations for the Last operation

LastIndex(s, substr string
LastIndexAny(s, chars string) int
LastIndexByte(s string, c byte) int
LastIndexFunc(s string, f func(rune) bool) int

As you can see all Last methods have a associated Index method expect for LastIndexRune.
I propose the implementation of LastIndexRune to make the association 1:1 between both of these operation sets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions