469,341 Members | 8,240 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,341 developers. It's quick & easy.

convert string to int

Hi,

Is there any function in C# to convert a string to a integer number like
'atoi()' function? Thanks,

CT
Nov 13 '05 #1
2 476073
System.Convert.ToInt32(sNumber, 10);

"Chi Tang" <ch********@hotmail.com> wrote in message
news:e0****************@TK2MSFTNGP11.phx.gbl...
Hi,

Is there any function in C# to convert a string to a integer number like
'atoi()' function? Thanks,

CT

Nov 13 '05 #2
int x = Int.Parse("23");

-Noah Coad
Microsoft MVP & MCP [.NET/C#]
"Chi Tang" <ch********@hotmail.com> wrote in message
news:e0****************@TK2MSFTNGP11.phx.gbl...
Hi,

Is there any function in C# to convert a string to a integer number like
'atoi()' function? Thanks,

CT

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Nathan | last post: by
3 posts views Thread by news.hku.hk | last post: by
5 posts views Thread by sarab | last post: by
3 posts views Thread by Petr Jakes | last post: by
5 posts views Thread by XML newbie: Urgent pls help! | last post: by
3 posts views Thread by Ursula | last post: by
3 posts views Thread by Shawn Ferguson | last post: by
12 posts views Thread by Peter | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by haryvincent176 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.