Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Got a tip ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97887] Re: [mg97843] Got a tip ?
  • From: Gerry Flanagan <flanagan at materials-sciences.com>
  • Date: Tue, 24 Mar 2009 05:35:10 -0500 (EST)
  • References: <200903230905.EAA27168@smc.vnet.net>

f[s_]:=First@ToCharacterCode[ToLowerCase[s]]-96/;StringQ[s]&&StringLength[s]==1

Gerry F

Fabrizio wrote:
> Hello,
>
> 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
>  
>
>   



  • References:
  • Prev by Date: Re: NDSolve error "nlnum"
  • Next by Date: Re: Got a tip ?
  • Previous by thread: Got a tip ?
  • Next by thread: Re: Got a tip ?