Skip to content

Add String#swapcase and Char#swapcase #10897

Open
@Daniel-Worrall

Description

While I personally do not have a realworld problem for this request, it's a common coding challenge method, and Ruby has String#swapcase

"abc".swapcase # => "ABC"
'a'.swapcase # => 'A'
"aBC".swapcase # => "Abc"

Does not break backwards compatibility, and improves compatibility when translating from Ruby.

Would be nice to make a search if #swapcase is used in any real world Ruby projects.

There have been varying opinions about it in the past about both its usefulness and whether the library should implement "nice to have" trivial methods like this.

Related Issues #2230 #2805 #2889 #7142 #8554

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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