I have to create a program that reverses phrases.
For example: when I write hello guys, I want syug olleh
hello guys
syug olleh
This is what
Here's a shorter way to do it:
forall (i=1:len(string)) string(i:i) = string(len(string)-i+1:len(string)-i+1)
It even saves a handful of bytes ! I'm not sure I'd suggest this was more intelligent though.