Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

change string to integer and vice versa

1 view
Skip to first unread message

Hector Martinez

unread,
May 4, 2003, 6:08:34 PM5/4/03
to

>How can I convert strings to integers,floats and doubles
>and vice versa.In other words what's equal to atoi()
itoa
>and such functions in C sharp?

You can use the class System.Convert

Convert have inside:

- ToDecimal()
- ToDouble()
- ToSingle()
- Etc...

And all the objects have an ToString() function.


Here you Have, Hector.

Natty Gur

unread,
May 5, 2003, 12:58:10 AM5/5/03
to
Hi,

Using ToString() will cause boxing and un-boxing since ToString is a method
of an object. Its better to use Convert.ToString().

--
Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
"Hector Martinez" <heco...@yahoo.com.mx> wrote in message
news:024301c31289$b456c1f0$3301...@phx.gbl...

0 new messages