Class: String

Inherits:
Object show all
Defined in:
lib/feldtruby/string/to_iso.rb,
lib/feldtruby/file/file_change_watcher.rb

Instance Method Summary collapse

Instance Method Details

#starts_with?(str) ⇒ Boolean

Returns:

  • (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_isoObject

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