Skip to content

strings: add Reverse #14777

Closed
Closed

Description

@rskumar

Core package strings should have Reverse() method, which will return a new String reversed.

I couldn't find any discussion or issue around it. What can be the reason to not have a basic string operation, used commonly by developers (though not much frequent).

Activity

  1. changed the title [-]Add strings.Reverse(...) method[/-] [+]strings: add Reverse[/+] on Mar 11, 2016
  2. bradfitz commented on Mar 11, 2016

    @bradfitz
    Contributor

    Do you have numbers to suggest it's used commonly? I've never needed it, except maybe in programming exercises while learning a new language.

  3. dominikh commented on Mar 11, 2016

    @dominikh
    Member

    It's also not a "basic string operation" once you take all aspects of Unicode into account.

  4. rskumar commented on Mar 11, 2016

    @rskumar
    Author

    Code using reversed (python) on github https://github.com/search?l=python&q=reversed%28&type=Code&utf8=%E2%9C%93 .. though most of them are learning exercises, but are we sure reverse is really not needed (even doing statistical analysis) etc? IMO, all generic libraries, should include implementations to avoid different developer implement it different way, and having bugs.

  5. bradfitz commented on Mar 11, 2016

    @bradfitz
    Contributor

    Sorry, I'm going to close this. I've never needed reverse for real programs.

    This bug seems hypothetical at best.

  6. locked and limited conversation to collaborators on Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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