VirtualString.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 millisecond timing precision mode. Millisecond timing precision mode is deprecated and will be removed in a future release. We recommend that you migrate your Mission Plans to nanosecond timing precision mode.

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

 

Method Signature

VirtualString.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.ToLowercase().Pad(myVariable1, myVariable2, myString3);

 

 

See also

VirtualString Object

VirtualString.Pad