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

Here's an example: using System;

class StringToInt

{

public static void Main()

{

String s = "105";

int x = Convert.ToInt32(s);

Console.WriteLine(x);

}

}

Showing Answers 1 - 4 of 4 Answers

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions