Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Add string/reverse.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
youchan committed Mar 7, 2015
1 parent bd61a91 commit 570ef81
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions string/reverse.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def reverse(string)
result = ""
string.length.times do |i|
result << string[string.length - i - 1]
end
end

0 comments on commit 570ef81

Please sign in to comment.