RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

A question about C#

L

Lost User

Guest
A question about C#

After spending 2 hours searching MSDN for this, I decided it might just be better to just ask here..

How do you convert a string to an int? (In Java, I would do int i = Integer.parseInt(theString), and surround it with a try-catch to make sure the string holds a valid integer.)

ATM I'm just trying to read a config file (I have it opening the file and doing ReadLine, then using indexOf and substring to split it into two strings, already. But I haven't been able to find any way to turn the string into an integer yet.)
 
W

Wasted

Guest
On C++ you would use this function (i guess the parms below ar correct):

int Itoa(char * src);
 
L

Lost User

Guest
I found it (took me a while):

int myInt = Int32.parse(myString);
 
Top