This method will return the digits between the strings, if no digits found it returns 0
public static string GetNumeric( string expression )
{
bool found = false;
string returnValue = “”;
foreach ( char c in expression )
{
if ( Char.IsNumber( c ) )
{
returnValue += c;
found = true;
}
}
if ( found == false )
{
returnValue = “0″;
}
return returnValue;
}
Author : Deepak Rao
Advertisement