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

Author Topic: How do I convert a string to an int in C#?  (Read 545 times)

Offline chinmay.sahooTopic starter

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 159
  • Karma: 0
    • Hot Shaper
How do I convert a string to an int in C#?
« on: 03-29-2016, 02:42:10 »
How do I convert a string to an int in C#?




Quote
using System;
     class conversion
     {
     public static void Main()
     {
     String s1 = "100";
     int y = Convert.ToInt32(s1);
     Console.WriteLine(y);
     }
     }


 

Related Topics

  Subject / Started by Replies Last post
0 Replies
600 Views
Last post 02-10-2016, 01:36:24
by chinmay.sahoo
0 Replies
652 Views
Last post 04-04-2016, 04:25:37
by chinmay.sahoo
1 Replies
702 Views
Last post 04-20-2016, 02:56:22
by TomClarke
0 Replies
1353 Views
Last post 06-08-2016, 07:32:24
by chinmay.sahoo
0 Replies
620 Views
Last post 09-23-2016, 06:19:03
by beingchinmay