Characters in Strings

Converting between strings and lists of characters.

This gives a list of the characters in the string:

Characters["A string."]

You can apply standard list manipulation operations to this list:

RotateLeft[%,3]

(RefLink[StringJoin, paclet:ref/StringJoin]) converts the list of characters back to a single string:

StringJoin[%]

Testing characters in a string.

All characters in the string given are letters:

LetterQ["Mixed"]

Not all the letters are uppercase, so the result is (RefLink[False, paclet:ref/False]):

UpperCaseQ["Mixed"]

Converting between upper case and lower case.

This converts all letters to upper case:

ToUpperCase["Mixed Form"]

Generating ranges of characters.

This generates a list of lowercase letters in alphabetical order:

CharacterRange["a","h"]

Here is a list of uppercase letters:

CharacterRange["T","Z"]

Here are some digits:

CharacterRange["0","7"]

(RefLink[CharacterRange, paclet:ref/CharacterRange]) will usually give meaningful results for any range of characters that have a natural ordering. The way (RefLink[CharacterRange, paclet:ref/CharacterRange]) works is by using the character codes that the Wolfram Language internally assigns to every character.

This shows the ordering defined by the internal character codes used by the Wolfram Language:

CharacterRange["T","e"]