aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref/strings.texi
diff options
context:
space:
mode:
authorStefan Monnier2010-12-10 19:13:08 -0500
committerStefan Monnier2010-12-10 19:13:08 -0500
commit2c302df3a13236bfbf8ea1b771d13618fcda8d71 (patch)
treef26dc9f22861dc37610de319d05255de058c221b /doc/lispref/strings.texi
parent0c747cb143fa227e78f350ac353d703f489209df (diff)
parent175069efeb080517afefdd44a06f7a779ea8c25c (diff)
downloademacs-2c302df3a13236bfbf8ea1b771d13618fcda8d71.tar.gz
emacs-2c302df3a13236bfbf8ea1b771d13618fcda8d71.zip
Merge from trunk
Diffstat (limited to 'doc/lispref/strings.texi')
-rw-r--r--doc/lispref/strings.texi63
1 files changed, 25 insertions, 38 deletions
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index 1128ca87d8a..94d2765a833 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -126,9 +126,8 @@ This function returns a string made up of @var{count} repetitions of
126 @result{} "" 126 @result{} ""
127@end example 127@end example
128 128
129 Other functions to compare with this one include @code{char-to-string} 129 Other functions to compare with this one include @code{make-vector}
130(@pxref{String Conversion}), @code{make-vector} (@pxref{Vectors}), and 130(@pxref{Vectors}) and @code{make-list} (@pxref{Building Lists}).
131@code{make-list} (@pxref{Building Lists}).
132@end defun 131@end defun
133 132
134@defun string &rest characters 133@defun string &rest characters
@@ -565,38 +564,6 @@ of text characters and general input events
565(@code{single-key-description} and @code{text-char-description}). These 564(@code{single-key-description} and @code{text-char-description}). These
566are used primarily for making help messages. 565are used primarily for making help messages.
567 566
568@defun char-to-string character
569@cindex character to string
570This function returns a new string containing one character,
571@var{character}. This function is semi-obsolete because the function
572@code{string} is more general. @xref{Creating Strings}.
573@end defun
574
575@defun string-to-char string
576@cindex string to character
577 This function returns the first character in @var{string}. If the
578string is empty, the function returns 0. The value is also 0 when the
579first character of @var{string} is the null character, @acronym{ASCII} code
5800.
581
582@example
583(string-to-char "ABC")
584 @result{} 65
585
586(string-to-char "xyz")
587 @result{} 120
588(string-to-char "")
589 @result{} 0
590@group
591(string-to-char "\000")
592 @result{} 0
593@end group
594@end example
595
596This function may be eliminated in the future if it does not seem useful
597enough to retain.
598@end defun
599
600@defun number-to-string number 567@defun number-to-string number
601@cindex integer to string 568@cindex integer to string
602@cindex integer to decimal 569@cindex integer to decimal
@@ -659,19 +626,39 @@ this function returns 0.
659@code{string-to-int} is an obsolete alias for this function. 626@code{string-to-int} is an obsolete alias for this function.
660@end defun 627@end defun
661 628
629@defun char-to-string character
630@cindex character to string
631This function returns a new string containing one character,
632@var{character}. This function is semi-obsolete because the function
633@code{string} is more general. @xref{Creating Strings}.
634@end defun
635
636@defun string-to-char string
637 This function returns the first character in @var{string}. This
638mostly identical to @code{(aref string 0)}, except that it returns 0
639if the string is empty. (The value is also 0 when the first character
640of @var{string} is the null character, @acronym{ASCII} code 0.) This
641function may be eliminated in the future if it does not seem useful
642enough to retain.
643@end defun
644
662 Here are some other functions that can convert to or from a string: 645 Here are some other functions that can convert to or from a string:
663 646
664@table @code 647@table @code
665@item concat 648@item concat
666@code{concat} can convert a vector or a list into a string. 649This function converts a vector or a list into a string.
667@xref{Creating Strings}. 650@xref{Creating Strings}.
668 651
669@item vconcat 652@item vconcat
670@code{vconcat} can convert a string into a vector. @xref{Vector 653This function converts a string into a vector. @xref{Vector
671Functions}. 654Functions}.
672 655
673@item append 656@item append
674@code{append} can convert a string into a list. @xref{Building Lists}. 657This function converts a string into a list. @xref{Building Lists}.
658
659@item byte-to-string
660This function converts a byte of character data into a unibyte string.
661@xref{Converting Representations}.
675@end table 662@end table
676 663
677@node Formatting Strings 664@node Formatting Strings