class String

Public Instance Methods

ljust(number_of_characters) click to toggle source

REMOVE when RubyMotion adds this

# File lib/project/ext/string.rb, line 14
def ljust(number_of_characters)
  if self.length < number_of_characters
    out = self
    out << " " * (number_of_characters - self.length)
    out
  else
    self
  end
end
rjust(number_of_characters) click to toggle source

REMOVE when RubyMotion adds this

# File lib/project/ext/string.rb, line 3
def rjust(number_of_characters)
  if self.length < number_of_characters
    out = " " * (number_of_characters - self.length)
    out << self
    out
  else
    self
  end
end