Builds a character expression from another one, by adding a specified character N times, or blanks to the left.
Str.PadLeft(Len [,FillChar])
Where:
Str
Is the character expression from which you want to add left blanks or with the FillChar if indicated
Len
Is the numeric expression that indicates the length of the returned string.
FillChar
Is the character that is added to the left side of ‘Str’. It is an optional parameter, if it is not specified then blanks will be added.
Type Returned:
Character
Data Types: Character, VarChar, LongVarChar
Generators:
.NET,
.NET Framework, Java, Ruby (up to GeneXus X Evolution 3), Visual FoxPro (up to GeneXus X Evolution 3)
Returns a character string, which is the result of adding the ‘FillChar’ to the left side of ‘Str’ as many times until the string is left as long as 'len'.
&MyText = “My string”
&Result=&MyText.PadLeft(10, ‘*’) // &Result value is “*My string”
&MyText = “My string”
&Result=&MyText.PadLeft(11, ‘*’) // &Result value is “**My string”
&MyText = “My string”
&Result=&MyText.PadLeft(12, ‘*’) // &Result value is “***My string”
&MyText = “My string”
&Result=&MyText.PadLeft(12) // &Result value is “ My string”
Note: All leading spaces from the original string will be removed before applying the function.
PadR function
PadL function
Trim function
LTrim function
RTrim function