MathGroup Archive 2009

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

Search the Archive

Re: Got a tip ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97855] Re: Got a tip ?
  • From: Raffy <raffy at mac.com>
  • Date: Tue, 24 Mar 2009 05:29:07 -0500 (EST)
  • References: <gq7jbp$qgp$1@smc.vnet.net>

A mapping for all your assignments:

$CharMap = Dispatch@Join[
    Thread[CharacterRange["a", "z"] -> Range[1, 26]],
    Thread[CharacterRange["A", "Z"] -> Range[27, 52]],
    {_ :> Throw["Unknown"]}
    ];

A function which takes a string, and applies the mapping:

convert[s_String] := Replace[Characters[s], $CharMap, {1}];


  • Prev by Date: Re: Got a tip ?
  • Next by Date: solving nonlinear simultaneous equations
  • Previous by thread: Re: Got a tip ?
  • Next by thread: Re: Got a tip ?