How to extract numeric value from String?

 Posted by Rajesh_Kumar on 1/19/2014 | Category: C# Interview questions | Views: 683 | Points: 40

We use Regex and its Match method to extract Number from String value.We have to create Regular Exp class object.and we have to pass string value to its Match method.We use \d used for extracting numeric value.

Regex regex = new Regex(@"\d+");

Match match = regex.Match("Rajesh Kumar Sathua Age 29");

if (match.Success)

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response