leftpad

leftpad()

Overview

The leftpad() function takes text and whitespaces as arguments. It returns the text, left-padded with white spaces equal to the specified number.

Return Type

  • Text

Syntax

<variable> = <text>.leftpad( <whitespaces>);

(OR)

<variable> = leftpad(<text>, <whitspaces> );
ParameterData typeDescription
<variable>TEXTVariable that will contain the returned text.
<text>TEXTThe text that will be left-padded with white spaces.
<whitespaces>NUMBER

Total number of whitespaces that need to be padded.

Note: A negative value will return the string without any changes.

Maximum value: 100,00

Examples

text = "Left";
newText = text.leftpad(6);    
//returns " Left"

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohodeluge.com