String.Pad(Variable, Variable) Method

Top 

Description

Returns a modified copy of the calling String with spaces 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 spaces are added. When side is "Left" or "Right", spaces are prepended or appended to the calling String, respectively. When side is "Both", spaces 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)

 

 

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

 

 

 

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);

 

 

See also

String Object

String.Pad

Parsing Dates and Times

Parsing Arbitrary String Data

Parsing Arbitrary String Data