Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/word_stats/string_extensions.rb
Instance Method Summary collapse
-
#remove_punctuation ⇒ Object
Removes all common forms of punctuation marks from the string.
Instance Method Details
#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 |