Class: String
- Defined in:
- lib/feldtruby/string/to_iso.rb,
lib/feldtruby/file/file_change_watcher.rb
Instance Method Summary collapse
- #starts_with?(str) ⇒ Boolean
-
#to_iso ⇒ Object
Convert to normal, iso formatted string.
Instance Method Details
#starts_with?(str) ⇒ Boolean
7 8 9 |
# File 'lib/feldtruby/file/file_change_watcher.rb', line 7 def starts_with?(str) self[0, str.length] == str end |
#to_iso ⇒ Object
Convert to normal, iso formatted string. Skip invalid and undefined utf-8 sequences in the conversion.
4 5 6 |
# File 'lib/feldtruby/string/to_iso.rb', line 4 def to_iso self.encode('ISO-8859-1', 'utf-8', :invalid => :replace, :undef => :replace) end |