Skip to content

Instantly share code, notes, and snippets.

@IceDragon200
Created July 16, 2015 14:29
Show Gist options
  • Save IceDragon200/e590d39e3bc4932345eb to your computer and use it in GitHub Desktop.
Save IceDragon200/e590d39e3bc4932345eb to your computer and use it in GitHub Desktop.
str = "Hello, World"
half = str.size / 2
n = 0
m = str.size - 1
while n < half
str[n], str[m] = str[m], str[n]
n += 1
m -= 1
end
puts str
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment