View difference between Paste ID: PwCf25Nw and ms9q4c8B
SHOW: | | - or go back to the newest paste.
1
    def ensure_length(str, length)
2-
      return if str.length == length
2+
      return str if str.length == length
3
      return str.ljust(length) if str.length < length
4
  
5
      str.slice(0, length)
6
    end