String.Pad(Variable, Variable, String) Method

Top 

Description

Returns a modified copy of the calling String withpadCharacter added so that the length of the returned String is equal to totalLength. If totalLength is less-than or equal-to the length of the calling String, no characters are added. When side is "Left" or "Right", characters are prepended or appended to the calling String, respectively. When side is "Both", characters are alternately prepended and then appended.

 

Timing Precision Mode

This page describes functionality in nanosecond timing precision mode.

Click here to see the documentation for this object in millisecond timing precision mode.

 

Method Signature

String.Pad(

Variable side,


Variable totalLength,


String padCharacter)

 

 

Arguments

side


Description:

Specifies whether to pad the calling String on the left, right, or both.

Valid Values:

Value

Label

0

Left

1

Right

2

Both

 

 

 

totalLength


Description:

Specifies the desired length of the returned String.

Valid Range:

totalLength ≥ 0

 

 

padCharacter


Description:

The character with which to pad the calling String. This argument must contain only a single character.

 

 

 

Return Value

Type:

string

 

 

Returns a modified copy of the calling String with characters added to achieve the specified length.

 

Syntax

myString1 = myString2.Pad(myVariable1, myVariable2, myString3);

 

 

See also

String Object

String.Pad

Parsing Dates and Times

Parsing Arbitrary String Data

Parsing Arbitrary String Data