simple-exercises/ruby-exercises/very-easy.rb
# Write a method that will take a string as input, and return a new
# string with the same letters in reverse order
Write a method that will take a string as input, and return a new
string with the same letters in reverse order
Write a method that will take a string as input and return a new string with the same letters in reverse order
def reverse s
  r = ""
  (1..s.length).each do |i|
    r += s[-i]
  end
  r
end
def reverse s r = "" ( 1 .. s . length ) . each do | i | r += s [ - i ] end r end
Write a method that will take a string as input, and return a new
string with the same letters in reverse order
Write a method that will take a string as input and return a new string with the same letters in reverse order
s
<not_specific>