Skip to content

Instantly share code, notes, and snippets.

@abdulrahmanAlotaibi
Created December 15, 2022 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abdulrahmanAlotaibi/2bee69214ee53a1e1bf82d2862b3eab6 to your computer and use it in GitHub Desktop.
Save abdulrahmanAlotaibi/2bee69214ee53a1e1bf82d2862b3eab6 to your computer and use it in GitHub Desktop.
Strings : Reverse String
func reverseString(s []byte) {
for i, j:= 0, len(s)-1 ; i < j && i < len(s) ; i,j= i+1, j-1 {
s[i], s[j] = s[j], s[i]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment