You are viewing a single comment's thread. Return to all comments →
def mask_article(string, arr) arr.map do |word| string.gsub!(word, strike(word)) if string.include? word end string end public def strike(string) "<strike>#{string}</strike>" end
Seems like cookies are disabled on this browser, please enable them to open this website
Ruby - Strings - Methods II
You are viewing a single comment's thread. Return to all comments →