aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref/strings.texi
diff options
context:
space:
mode:
authorLars Ingebrigtsen2020-12-21 20:01:28 +0100
committerLars Ingebrigtsen2020-12-21 20:01:28 +0100
commitb3dec3176673fa99e57e3916b36ea4367d47c0fa (patch)
treee9a6a6b6926a9abd4c93138ed6e7acb84438a318 /doc/lispref/strings.texi
parent87e422f1044068a4d27e5e4bfdbc664d9e4bbc43 (diff)
downloademacs-b3dec3176673fa99e57e3916b36ea4367d47c0fa.tar.gz
emacs-b3dec3176673fa99e57e3916b36ea4367d47c0fa.zip
Add `string-pad'
* doc/lispref/strings.texi (Creating Strings): Document it. * lisp/emacs-lisp/shortdoc.el (string): Add example. * lisp/emacs-lisp/subr-x.el (string-pad): New function.
Diffstat (limited to 'doc/lispref/strings.texi')
-rw-r--r--doc/lispref/strings.texi9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index e4ca2617512..958ae4c0a15 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -419,6 +419,15 @@ Split @var{string} into a list of strings on newline boundaries. If
419@var{omit-nulls}, remove empty lines from the results. 419@var{omit-nulls}, remove empty lines from the results.
420@end defun 420@end defun
421 421
422@defun string-pad string length &optional padding
423Pad @var{string} to the be of @var{length} using @var{padding} as the
424padding character (defaulting to the space character). If
425@var{string} is shorter than @var{length}, no padding is done. If
426@var{length} is positive, the padding is done to the end of the
427string, and if it's negative, to the start of the string (using the
428absolute value).
429@end defun
430
422@node Modifying Strings 431@node Modifying Strings
423@section Modifying Strings 432@section Modifying Strings
424@cindex modifying strings 433@cindex modifying strings