Skip to content

Latest commit

 

History

History
38 lines (31 loc) · 854 Bytes

left.adoc

File metadata and controls

38 lines (31 loc) · 854 Bytes

left()

Important

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.

Example
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"