Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/string_extension.rb
Instance Method Summary collapse
Instance Method Details
#only_whitespace? ⇒ Boolean
6 7 8 |
# File 'lib/string_extension.rb', line 6 def only_whitespace? !!(self =~ /\A[\s]+\Z/) end |
#remove_invalid_chars ⇒ Object
2 3 4 |
# File 'lib/string_extension.rb', line 2 def remove_invalid_chars self.gsub(/[^\w\s]/, "") end |