CSharp examples for System:Converter
Convert String To Int
using System.Threading.Tasks; using System.Text; using System.Linq; using System.Collections.Generic; using System;/*w w w . j a v a 2 s.c o m*/ public class Main{ public static int ConvertStringToInt(string value) { int intValue; bool IsValid = int.TryParse(value, out intValue); if (IsValid == false) { throw new Exception("String is not in the right format - Int32"); } return intValue; } }