Re: Converting Strings to Ints.
- To: mathgroup at smc.vnet.net
- Subject: [mg63304] Re: [mg63277] Converting Strings to Ints.
- From: János <janos.lobb at yale.edu>
- Date: Fri, 23 Dec 2005 05:08:29 -0500 (EST)
- References: <200512200919.EAA28501@smc.vnet.net> <200512210435.XAA14697@smc.vnet.net> <200512220504.AAA05693@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On Dec 22, 2005, at 12:04 AM, Chrisantha wrote: > Dear All, > > I have a list of strings representing numbers, i.e. a = > {"12223","11313","2424"} that I generated in XML and read into > mathematica. How do I convert this into a list of integers? > > Yours Ever and Merry Christmas, > > Chrisantha Here is a newbie approach: In[1]:= str = {"12223", "11313", "2424"} Out[1]= {"12223", "11313", "2424"} In[2]:= ToExpression[str] Out[2]= {12223, 11313, 2424} In[3]:= Head[%[[1]]] Out[3]= Integer János ---------------------------------------------- Trying to argue with a politician is like lifting up the head of a corpse. (S. Lem: His Master Voice)
- References:
- Expression timing; a black art?
- From: AES <siegman@stanford.edu>
- Re: Expression timing; a black art?
- From: "Carl K. Woll" <carlw@wolfram.com>
- Converting Strings to Ints.
- From: Chrisantha <ctf20@sussex.ac.uk>
- Expression timing; a black art?