Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/nub/string.rb
Overview
Monkey patch string with some useful methods
Instance Method Summary collapse
-
#to_ascii ⇒ Object
Convert the string to ascii, stripping out or converting all non-ascii characters.
Instance Method Details
#to_ascii ⇒ Object
Convert the string to ascii, stripping out or converting all non-ascii characters
26 27 28 29 30 31 32 33 34 |
# File 'lib/nub/string.rb', line 26 def to_ascii = { :invalid => :replace, :undef => :replace, :replace => '', :universal_newline => true } return self.encode(Encoding.find('ASCII'), ) end |