CSharp examples for System:Int32
Convert String to Int Value Or Zero
using System.Text; using System.IO;/*w ww . j a v a 2 s .c o m*/ using System.Globalization; using System.Collections.Generic; using System; public class Main{ public static int IntValueOrZero(this string value) { int result; if (int.TryParse(value, out result)) { return result; } else { return 0; } } }