Mega Code Archive

 
Categories / Ruby / String
 

Pushes provided string onto end of self

class String   def push_word(other)     newself = self + other.to_s     self.replace(newself)   end end a = "this is a test" puts a.push_word "another"