Lasso Soft Inc. > Home

[String->PadLeading]

[String->PadLeading] modifies the base string in-place by padding the front of the string to the specified length. An optional second parameter specifies the padding character. The padding character defaults to a space.

  • Syntax
  • Parameters
[Variable: 'myString' = 'String Value']
[$myString->(PadLeading: Length)]
[Variable: 'myString']

<?LassoScript
Variable: 'myString' = 'String Value';
$myString->(PadLeading: Length, 'Char')]
Output: $myString;
?>
Required Parameters
Length The desired length for the string.
Optional Parameters
Padding Char The passing character to use. Defaults to space.
Examples

To pad the start of a string to a desired length:

Use the [String->PadLeading] tag. The following example pads the string out to 32 characters by adding asterisks to the start of the string.

[Variable: 'myString' = 'A quick brown fox']
[$myString->(PadLeading: 32, '*')]
[Output: $myString]
Result:
***************A quick brown fox
Tag Link [String->PadLeading] Category String
Type Member Data Source Any
Support Preferred Version 7.0
Output Type None Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft