GNU Emacs Lisp Reference Manual
The character case functions change the case of single characters or of the contents of strings. The functions convert only alphabetic characters (the letters `A' through `Z' and `a' through `z'); other characters are not altered. The functions do not modify the strings that are passed to them as arguments.
The examples below use the characters `X' and `x' which have ASCII codes 88 and 120 respectively.
When the argument to downcase is a string, the function creates and returns a new string in which each letter in the argument that is upper case is converted to lower case. When the argument to downcase is a character, downcase returns the corresponding lower case character. This value is an integer. If the original character is lower case, or is not a letter, then the value equals the original character.
(downcase "The cat in the hat")
=> "the cat in the hat"
(downcase ?X)
=> 120
When the argument to upcase is a string, the function creates and returns a new string in which each letter in the argument that is lower case is converted to upper case.
When the argument to upcase is a character, upcase returns the corresponding upper case character. This value is an integer. If the original character is upper case, or is not a letter, then the value equals the original character.
(upcase "The cat in the hat")
=> "THE CAT IN THE HAT"
(upcase ?x)
=> 88
The definition of a word is any sequence of consecutive characters that are assigned to the word constituent syntax class in the current syntax table (See Syntax Class Table).
When the argument to capitalize is a character, capitalize has the same result as upcase.
(capitalize "The cat in the hat")
=> "The Cat In The Hat"
(capitalize "THE 77TH-HATTED CAT")
=> "The 77th-Hatted Cat"
(capitalize ?x)
=> 88