Ruby puzzle

Soldato
Joined
24 Nov 2002
Posts
16,378
Location
38.744281°N 104.846806°W
How would I remove all of the words from a string that are in an array?

Surely there is a more efficient way than:
Code:
common_words.each do |word|
	string = string.gsub(word,"")
end

Thanks.
 
Last edited:
Back
Top Bottom