rightpad

rightpad()

Overview

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

Return Type

  • Text

Syntax

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

(OR)

<variable> = rightpad(<text>, <whitespaces> );
ParameterData typeDescription
<variable>TEXTVariable which will contain the returned text.
<text>TEXTThe text which will be right-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 = "Right";
newText = text.rightpad(6);    //returns "Right "

Share this post : FacebookTwitter

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

Write to us: support@zohodeluge.com