Please see this code snippet and tell me what to do
using System;
class me
{
public static void Main()
{
string one;
int a;
one=Console.ReadLine();
a=(int)one;
Console.WriteLine(a);
}
}
the code gives an error. I want to convert it to an integer without using Convert.ToInt32() method. I am trying to convert it explicitly. Is there no other way apart from Convert.ToInt32()?
Loading
abdullahPosted Jan 5, 2006, 4:22 PM
Hi...
that will be via Parsing......
String a = "152";
int x = Int.Parse(a);
Good luck....