Method: String#remove_punctuation
- Defined in:
- lib/word_stats/string_extensions.rb
#remove_punctuation ⇒ Object
Removes all common forms of punctuation marks from the string.
4 5 6 7 |
# File 'lib/word_stats/string_extensions.rb', line 4 def remove_punctuation regex = /[\.\,\!\?\;\[\]\(\)\'\"\/\\\`]/ self.gsub(regex,'') end |