MathGroup Archive 2007

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

Search the Archive

Re: String to number

  • To: mathgroup at smc.vnet.net
  • Subject: [mg73212] Re: [mg73174] String to number
  • From: jmt <jmt at dxdydz.net>
  • Date: Wed, 7 Feb 2007 06:18:47 -0500 (EST)
  • References: <200702060819.DAA24596@smc.vnet.net>

On Tuesday 06 February 2007 09:19, Jos=C3=A9 Carlos Santos wrote:
> Hi all:
>
> The ToString command generates a string from an expression. Is there a
> similar command which generates numbers from strings? What I mean by
> this is: is there a command (let's call it ToNumber) such that
>
> ToNumber["12"]
>
> generates the number 12?
>
> Best regards,
>
> Jose Carlos Santos
>
>

ToExpression will do want you want, for instance :

str="12"

1 + ToExpression[str]
will retrun 13


  • Prev by Date: Re: Point inside polygon
  • Next by Date: Re: Passing a list as seperate parameters?
  • Previous by thread: Re: String to number
  • Next by thread: Re: String to number