MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Got a tip ?

  • To: mathgroup at
  • Subject: [mg97871] Re: Got a tip ?
  • From: Bill Rowe <readnews at>
  • Date: Tue, 24 Mar 2009 05:32:10 -0500 (EST)

On 3/23/09 at 4:05 AM, Tekcitizen at (Fabrizio) wrote:

>I want to write a function that translates its argument (which is a
>letter of the alphabet) into a numerical value.

>f[a] = 1 f[b] = 2

Use the built-in function ToCharacterCode, i.e.,

In[2]:= First@ToCharacterCode["a"]

Out[2]= 97

  • Prev by Date: Re: Selecting left hand sides from assignments
  • Next by Date: Re: Got a tip ?
  • Previous by thread: Re: Got a tip ?
  • Next by thread: Re: Got a tip ?