Get Numeric Value from Alphanumeric string in C#

  1. string s = "rohan%9999gupta-#999999";  
  2. var output = Regex.Replace(s, "[^0-9]+"string.Empty);