# File lib/core/facets/string/trim.rb, line 27
  def trim(num=0)
    #d = /\A.*\n\s*(.)/.match( self )[1]
    #d = /\A\s*(.)/.match( self)[1] unless d

    md = /\A.*\n\s*(.)/.match(self) || /\A\s*(.)/.match(self)

    d = md[1]

    return '' unless d

    if num == 0
      gsub(/\n\s*\Z/,'').gsub(/^\s*[#{d}]/, '')
    else
      gsub(/\n\s*\Z/,'').gsub(/^\s*[#{d}]/, ' ' * num)
    end
  end