Product Site

5.1.7.71. left

Returns a string of length length, containing the leftmost length characters of the receiving string. The string returned is padded with pad characters (or truncated) on the right as needed. The default pad character is a blank. The length must be a positive whole number or zero. The left method is exactly equivalent to substr(1, length, pad).
Example 5.108. String class — left method
"abc d"~left(8)        -->    "abc d   "
"abc d"~left(8,".")    -->    "abc d..."
"abc  def"~left(7)     -->    "abc  de"