# (lpad 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="219"></a> ## (lpad string integer) --- Pad that string with spaces on the left. --- This function controls the length and spacing of the 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 beginning (or left side) of the string. **NOTE** Use rpad to perform the same operations on the end (or right side) of the string. ### Examples | Code | Returns | | --- | --- | | (**lpad** "Planet X" 4\) | "Plan" | | (**lpad** "Planet X" 15\) | "Planet X" | | (setq a "Planet X") | | | (**lpad** a 6\) | "Planet" | **Tell me about...** [(rpad string integer)](%28rpad%20string%20integer%29.md) [(setq symbol1 statement1 \[symbol2 statement2\] ...)](%28setq%20symbol1%20statement1%20-symbol2%20statement2-%20...%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/%28lpad%20string%20integer%29.md)