MathGroup Archive 2003

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

Search the Archive

Re: type casting


Presumably your string has numbers in string format. Use ToExpression to
convert numbers in string format to numbers.

In[1]:=
aString = {"2", "4", "5.5"};

In[2]:=
Head /@ aString
Out[2]=
{String, String, String}

In[3]:=
ToExpression[aString]
Out[3]=
{2, 4, 5.5}

In[4]:=
Head /@ %
Out[4]=
{Integer, Integer, Real}

Tomas Garza
Mexico City
----- Original Message -----
From: "Tolonen, Ellen N" <entolonen at utep.edu>
To: mathgroup at smc.vnet.net
Subject: [mg39836] [mg39800] type casting


> Hello.
>
> I am I new Mathematica user and am trying to master input/output.  Is
there
> any way to type cast a string into number format?
>
>
> Ellen Tolonen
> entolonen at utep.edu
>
>




  • Prev by Date: Re: type casting
  • Next by Date: Symbols and Lists
  • Previous by thread: type casting
  • Next by thread: Re: type casting