Skip to content

Instantly share code, notes, and snippets.

@reuben-sutton
Forked from thehenster/to_string
Created October 26, 2012 09:09
Show Gist options
  • Save reuben-sutton/3957772 to your computer and use it in GitHub Desktop.
Save reuben-sutton/3957772 to your computer and use it in GitHub Desktop.
to_string.rb
########
# Author: Henry Turner, Reuben Sutton
# Project: to_string
# Description: A speedy algorithm to convert a string to a string
# License: MIT
########
def to_string
# process the string
new_string = ""
this_string_converted_to_a_string = "#{self.to_s}"
 this_string_converted_to_a_string.each do |this_character_of_this_string_converted_to_a_string|
new_string << "#{this_character_of_this_string_converted_to_a_string.to_s}"
end
return new_string
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment