leftpad()

leftpad()

Overview

The leftpad() function takes string and stringSize as arguments. It returns the string, left-padded with white spaces so that the final length of the string (including white spaces) is equal to the specified stringSize.

Return Type

  • Text

Syntax

<variable> = <string>.leftpad( <stringSize>);

(OR)

<variable> = leftpad(<string>, <stringSize> );
ParameterDescriptionData type
<variable>Variable which will contain the returned string.TEXT
<string>The string which will be left-padded with white spaces.TEXT
<stringSize>

This string's first character's first occurrence will be checked in the string.

A negative value will return the string without any changes.

NUMBER

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