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 from string to integer

  • To: mathgroup at smc.vnet.net
  • Subject: [mg56413] Re: Converting from string to integer
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Sun, 24 Apr 2005 03:29:04 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 4/23/05 at 1:16 AM, norge20_ at hotmail.com (Magnus) wrote:

>I have strings consisting of numbers. Now; how do I make them all
>of integer type?

>Ex: "0123" ---> 123

Probably the simplest is to use ToEpression, i.e.,

In[1]:=ToExpression["0123"]
Out[1]=123

Another approach would be to use ReadList with StringToStream, i.e.,

In[2]:=First@ReadList[StringToStream["0123"], Number]
Out[2]=123
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: Re: A bug in Integrate ?
  • Next by Date: Re: Re: SpinShow problem
  • Previous by thread: Re: Converting from string to integer
  • Next by thread: Re: Converting from string to integer