lundi 2 mars 2015

Simple method to remove pattern matching regex from string in Ruby

Is there a more succinct way than @string.gsub(/regex/, '') to cut a pattern from a string?


I know #slice exists, but I need a reverse of it, returning the portions that were not sliced.


Aucun commentaire:

Enregistrer un commentaire