Monday, March 30, 2015

How do I convert a string to an int in C#?

Question:How do I convert a string to an int in C#??

Answer: </P><P align=justify>Here&#39;s an example: using System;</P><P align=justify>class StringToInt</P><P align=justify>{</P><P align=justify>public static void Main()</P><P align=justify>{</P><P align=justify>String s = "105";</P><P align=justify>int x = Convert.ToInt32(s);</P><P align=justify>Console.WriteLine(x);</P><P align=justify>}</P><P align=justify>}

Tags:Interview Questions, Microsoft, C#,

Please submit your Interview Answer for the above Question via replying to this post. Thank you for visiting to our blog, Have a Good Day!.



Sponsor Advertisement




Medical Billing Software

Hospital Management System Software

Hospital Management System (HMS) Software is developed for multispeciality hospitals, to cover a wide range of hospital administration and management processes with financial accounting, voucher entry, pharmacy, patients module etc features...

No comments:

Post a Comment