# (rpad string integer)
[GstarCAD 2012](../../../Index.md) → [Developer Reference](../../%28Developer%20Reference%29.md) → [AutoLISP Reference](../%28AutoLISP%20Reference%29.md) → [LISP Functions](%28LISP%20Functions%29.md)
<a id="257"></a>
## (rpad string integer)
---
Pad that string with spaces on the right.
---
This function controls the length and spacing of a string when it is printed. The *integer* argument represents the number of characters or spaces the *string* should have. When the number is less than the total number of characters in the string, the *string* is truncated to allow only the specified number of characters. When the number is greater than the number of characters in the *string*, additional spaces are added to the end (or right side) of the string.
**NOTE** Use [lpad](%28lpad%20string%20integer%29.md) to handle the same operations on the beginning (or left side) of the string.
### Examples
| Code | Returns |
| --- | --- |
| (**rpad** "Einstein" 4\) | "Eins" |
| (**rpad** "Einstein" 15\) | "Einstein " |
| | |
| (setq a "Einstein") | |
| (**rpad** a 6\) | "Einste" |
**Tell me about...**
[(lpad string integer)](%28lpad%20string%20integer%29.md)
[(setq symbol1 statement1 \[symbol2 statement2\] ...)](%28setq%20symbol1%20statement1%20-symbol2%20statement2-%20...%29.md)
[(trim string \[flag\])](%28trim%20string%20-flag-%29.md)
[LISP Compatibility](../LISP%20Compatibility.md)
[Programming Overview of LISP (LISt Processing) Language](../Programming%20Overview%20of%20LISP%20%28LISt%20Processing%29%20Language.md)
<a id="holding"></a>
## Other versions with matching text
[GstarCAD 2011](../../../../2011/Developer%20Reference/AutoLISP%20Reference/LISP%20Functions/%28rpad%20string%20integer%29.md)