LetterNumber

LetterNumber["c"]

gives the position of the character c in the English alphabet.

LetterNumber["c",alpha]

gives the position of c in the alphabet specified by alpha.

LetterNumber["string",]

gives a list of the positions of characters in string.

Details

  • The character c can be either uppercase or lowercase.
  • An alphabet can be specified by the entity for a language or by its standard name.
  • If a character does not appear in the specified alphabet, LetterNumber gives 0.

Examples

open allclose all

Basic Examples  (4)

The fourth letter in the English alphabet is d:

LetterNumber works the same with uppercase letters:

The third letter in the Greek alphabet is :

Find the position of a letter in the Russian alphabet:

Get positions of each of the letters in a string:

Properties & Relations  (3)

LetterNumber takes letters in the same order as Alphabet:

FromLetterNumber inverts the operation performed by LetterNumber:

LetterNumber gives the position of a character in an alphabet:

ToCharacterCode gives the integer code of a character in an encoding:

Possible Issues  (2)

LetterNumber by default assumes the English alphabet:

LetterNumber operates on strings, not symbol names:

Wolfram Research (2015), LetterNumber, Wolfram Language function, https://reference.wolfram.com/language/ref/LetterNumber.html (updated 2017).

Text

Wolfram Research (2015), LetterNumber, Wolfram Language function, https://reference.wolfram.com/language/ref/LetterNumber.html (updated 2017).

CMS

Wolfram Language. 2015. "LetterNumber." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/LetterNumber.html.

APA

Wolfram Language. (2015). LetterNumber. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LetterNumber.html

BibTeX

@misc{reference.wolfram_2024_letternumber, author="Wolfram Research", title="{LetterNumber}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/LetterNumber.html}", note=[Accessed: 18-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_letternumber, organization={Wolfram Research}, title={LetterNumber}, year={2017}, url={https://reference.wolfram.com/language/ref/LetterNumber.html}, note=[Accessed: 18-December-2024 ]}