Skip to content

HelpWanted: Remove last character then find index of sep string #20507

@ghost

Description

I do some string parse work.
Remove last character then find index of sep string.

I really want is: Does there have a easy way(less code and better performance) to resolve my problem?
If don't, How can I compare the three way I wrote(both memory used and performance)?

There are what method I found:

https://play.golang.org/p/2H84WYu2Mp
https://play.golang.org/p/JyFWZTtTfe

https://play.golang.org/p/VpHzAZXk6b

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions