Extract Number from String representation.

Rajesh_Kumar
Posted by Rajesh_Kumar under C# category on | Points: 40 | Views : 584
using System;
using System.Text.RegularExpressions;

Regex regex = new Regex(@"\d+");
Match match = regex.Match("ABC 123 def");

if (match.Success)
{
lbl_mesaage.Text = match.Value;
}


Output would be:123

Comments or Responses

Login to post response