Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

RE: Converting Strings to Ints.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63302] RE: [mg63277] Converting Strings to Ints.
  • From: "David Park" <djmp at earthlink.net>
  • Date: Fri, 23 Dec 2005 05:08:27 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Chrisantha,

Use ToExpression.

strs = {"12223", "11313", "2424"};
ToExpression /@ strs
Head /@ %
{12223, 11313, 2424}
{Integer, Integer, Integer}

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/ 


From: Chrisantha [mailto:ctf20 at sussex.ac.uk]
To: mathgroup at smc.vnet.net


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



  • Prev by Date: Re: Replacement equivalence?
  • Next by Date: Re: Converting Strings to Ints.
  • Previous by thread: Carriage return leads to skipping of cells
  • Next by thread: Re: Converting Strings to Ints.