MathGroup Archive 2006

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

Search the Archive

Re: Manipulate list elements

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67726] Re: Manipulate list elements
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Thu, 6 Jul 2006 06:51:56 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <e8ftmb$qch$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

ute.paul at gmail.com wrote:
> I have a list of words. These words are written in capital letters. I
> need a list with these words in lower case letters. How can I
> manipulate the list elements that the capital letters become lower case
> letters?
> Example: list={{ABILITY, CAPABILITY},{PERSON, FLY}} =>list={{ability,
> capability},{person, fly}}
> 

Either of the following expressions will do it depending on whether your 
  original list is a list of symbols or a list of strings.

In[1]:=
list = Map[ToString, {{ABILITY, CAPABILITY},
     {PERSON, FLY}}, {2}]

Out[1]=
{{"ABILITY", "CAPABILITY"},
   {"PERSON", "FLY"}}

In[2]:=
ToLowerCase /@ list

Out[2]=
{{"ability", "capability"},
   {"person", "fly"}}

In[3]:=
lst = {{"ABILITY", "CAPABILITY"}, {"PERSON", "FLY"}}

Out[3]=
{{"ABILITY", "CAPABILITY"},
   {"PERSON", "FLY"}}

In[4]:=
ToLowerCase /@ lst

Out[4]=
{{"ability", "capability"},
   {"person", "fly"}}

HTH,
Jean-Marc


  • Prev by Date: Re: Beginner--Simplest question: How to control some values in Input dialog box
  • Next by Date: Re: Beginner--Simplest question: How to control some values in Input dialog box
  • Previous by thread: Re: Manipulate list elements
  • Next by thread: Another limit problem