We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Golang doesn't seem to have an inbuilt function to reverse a given string. Here is my proposal for a basic function to reverse a string in Golang.
func Reverse(s string) string { var reversed string for _, v := range s { reversed = string(v) + result } return reversed }
This function can be added to src/strings/strings.go, along with other string functions such as explode, trim, uppercase etc.
The text was updated successfully, but these errors were encountered:
Hi,
this has been proposed, and rejected, in the past. See #14777 and #36887, in particular #36887 (comment):
strings.Reverse is a duplicate of #14777. It remains not needed often enough to merit inclusion in the standard library.
Closing here as a dup.
Sorry, something went wrong.
No branches or pull requests
Golang doesn't seem to have an inbuilt function to reverse a given string. Here is my proposal for a basic function to reverse a string in Golang.
This function can be added to src/strings/strings.go, along with other string functions such as explode, trim, uppercase etc.
The text was updated successfully, but these errors were encountered: