public void reverseString(char[] s) { char[] fixedS = s.clone(); for (int i = 0; i < s.length; i++) { s[i] = fixedS[(fixedS.length - 1) - i]; } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter