Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Casting strings

Status
Not open for further replies.

Pyramus

Programmer
Dec 19, 2001
237
GB
Isn't it possible in .NET to cast strings to ints and longs? I'm trying and getting compile errors.
 
Have you tried things along the line of:

Code:
int.Parse(yourString);
 
or:
Code:
int i = Convert.ToInt32(yourString);
Don't forget your try...catch block to prevent format exceptions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top