Previous Topic

Next Topic

RPad - MaxBasic Function

RPad(String1: String, Number: Number[, String2: String]): String

Right pad string. Returns a string with exactly Number of characters. If String2 is specified, the pad character is the first character of String2, otherwise the pad character is a space. The result is String1 padded on the right with the pad character to produce a string of exactly Number characters. If the length of String1 is greater than number, then the leftmost Number characters of String1 are returned.

RPad function syntax has these named arguments:

Parameter

Description

String1

Required. String to be padded with additional characters.

Number

Required. The length of the string to be returned.

String2

Optional. If supplied, the first character of String2 will be used to pad String1.

For example:

  Print RPad("12345", 8, "abc")

Returns: 12345aaa

See Also

String Functions

Book Contents

Book Index