Converting a string to an int

I have a mess… I could spend all day explaining why I have an ints in a string array. Does anybody have a quick fix? C# C# C#

You can int.TryParse(). There are many other methods, but most will raise exceptions that you likely want to write code to catch. If you don’t want to deal with exceptions, int.TryParse() will do the job.

Good luck! :wink:

private int xc = System.Int32.Parse("123456789");