Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/word_stats/string_extensions.rb

Instance Method Summary collapse

Instance Method Details

#remove_punctuationObject

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