Mega Code Archive

 
Categories / Ruby / String
 

Chomp! returns nil without altering the string because there is no record separator at the end of the string

joe = <<limerick T q limerick joe.chomp! puts joe joe.chomp! puts joe joe.chomp! # => nil puts joe