class String

Add some useful methods for String class:

deleted.

Public Instance Methods

delete_at(n) click to toggle source
# File lib/ruby_figlet/parser.rb, line 19
def delete_at n
  dup.delete_at! n
end
delete_at!(n) click to toggle source
# File lib/ruby_figlet/parser.rb, line 14
def delete_at! n
  slice! n
  self
end
each() { |self| ... } click to toggle source
# File lib/ruby_figlet/interface.rb, line 2
def each
  i = 0
  while i < length
    yield self[i]
    i += 1
  end
end
to_utf8() click to toggle source
# File lib/ruby_figlet/parser.rb, line 7
def to_utf8
  str = force_encoding 'UTF-8'
  return str if str.valid_encoding?
  str = str.force_encoding 'BINARY'
  str.encode 'UTF-8', :invalid => :replace, :undef => :replace
end