CSharp examples for System:String Parse
Attempts to parse the string value as an Int32.
using System.Text.RegularExpressions; using System.Text; using System.Linq; using System.Globalization; using System.ComponentModel; using System.Collections.Generic; using System;// w ww . j a va 2 s . c om public class Main{ /// <summary> /// Attempts to parse the string value as an Int32. /// </summary> /// <param name="value"></param> /// <returns></returns> public static bool CanParseInt32(this string value) { if (value == null) return false; int tmp; if (int.TryParse(value, out tmp)) return true; return false; } }