Wolfram Research, Inc.
2.7.4 Characters in Strings
Converting between strings and lists of characters.
This gives a list of the characters in the string.
In:= Characters["A string."]
You can apply standard list manipulation operations to this list.
In:= RotateLeft[%, 3]
StringJoin converts the list of characters back to a single string.
Testing characters in a string.
All characters in the string given are letters.
Not all the letters are upper case, so the result is False.
Converting between upper and lower case.
This converts all letters to upper case.
In:= ToUpperCase["Mixed Form"]
Generating ranges of characters.
This generates a list of lower-case letters in alphabetical order.
In:= CharacterRange["a", "h"]
Here is a list of upper-case letters.
In:= CharacterRange["T", "Z"]
Here are some digits.
In:= CharacterRange["0", "7"]
CharacterRange will usually give meaningful results for any range of characters that have a natural ordering. The way CharacterRange works is by using the character codes that Mathematica internally assigns to every character.
This shows the ordering defined by the internal character codes used by Mathematica.
In:= CharacterRange["T", "e"]