left()

Deprecated in 5.0.

Replaced with method left() of the string instance.

left(string, length, pad): String

Returns the string of length characters of string, optionally padded with pad character instead of a blank (space).

Table 1. Parameters

string

String

The string which will be processed.

length

Integer

The number of character to return, must be a positive integer.

pad

String

The pad character to use instead of blank spaces. Optional parameter.

Return

String of the left length characters.

println(left("abc d",8)); //Will print "abc d   "
println(left("abc d",8,".")); //Will print "abc d..."
println(left("abc  def",7)); //Will print "abc  de"