This method will return the digits between the strings, if no digits found it returns 0
Introduction
GetNumeric Function
This method will return the digits between the strings, if no digits found it returns 0
/// <summary>
/// GetNumeric Function
/// This method will return the digits between the strings, if no digits found it returns 0
/// </summary>
/// <param name="expression"></param>
/// <returns></returns>
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;
}