Ruby

A simple Ruby Sentence Swap


@in_str = "This is a string to be reversed"

@instr_a = @in_str.split(" ");

@instr_a.reverse!

@rev = @instr_a.join(" ");

puts "Reversed String = #{@rev}"