Mega Code Archive

 
Categories / Ruby / String
 

Enter a string as the argument to []=, and it will return the new, corrected string, if found; nil otherwise

speaker = "this is a test, 2007" speaker[", 2007"]= "III" # => "III" p speaker