info.mailtraq.com > Management > Script Functions A-Z > RJ() RJ()Pads text to a specified length by adding characters taken sequentially from a given pad string to the left of the input string. If the text is longer than the specified length, it is trimmed from the right as required.
output := RJ( text [ , length [ , pad ] ] )
- text
- The string to which the padding characters are to be added
- length
- Optional; the required length, as an integer, of the output string. If length is shorter than text , text is reduced to length for the output, otherwise characters are taken successively from pad until output reaches length. If length is not provided, a default of 70 characters is used.
- pad
- Optional; the characters with which to pad text until length is reached. If pad is not given, the text is padded, if required, with spaces (ASCII 32) by default.
- outputThe string result of the function which is always length
- characters long.
// Pad number with leading zeros
"002" := RJ("2", 3, "0"); |