using System; using System.Linq; using System.Diagnostics; using System.Text.RegularExpressions; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { string str = "+123-456/7890"; var onlyNumbers = Convert.ToInt64(Regex.Replace(str, "[^0-9]+", "")); } } }