Official Content

Builds a character expression from another one, by adding a specific character N times, or blanks to the right.


PadR(Str, Len [,FillChar])


   Is the character expression from which you want to add right blanks or the FillChar if indicated.

   Is the numeric expression that indicates the length of the returned string.

   Is the caracter that is added to the right side of ‘Str’. It is an optional parameter, if it is not specified then blanks will be added.

Type returned:


Objects:   Procedure, Transaction, Web PanelPanelData Provider
Generators: .NET, .NET Framework, JavaApple, Android, Angular


Returns a character string, aligned to the right, which is the result of concat the specified ‘FillChar’ , ‘len’ times to the right side of the ‘Str’  specified to the function.


PadR(“My string”, 14) = “My string     ”
PadR(“My string”, 14, ‘*’) = “My string*****”

Note: All trailing spaces from the original string will be removed before applying the function. The implementation of the function is similar to the following:

PadR(string text, int size, string fill)
  return Left(RTrim(text) + Replicate(fill, size), size);

See Also

PadRight method
PadLeft method
PadL function
Trim function
LTrim function
RTrim function


Last update: November 2023 | © GeneXus. All rights reserved. GeneXus Powered by Globant