Skip to content

Instantly share code, notes, and snippets.

@luckyruby
Created February 8, 2012 20:58
Show Gist options
  • Save luckyruby/1773773 to your computer and use it in GitHub Desktop.
Save luckyruby/1773773 to your computer and use it in GitHub Desktop.
class String
def char_replace(position, char)
self[0...position] + char + self[position + 1 .. -1]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment