HexEdit/CalcDlg.cpp
ExprStringType CCalcDlg::without_parens(const ExprStringType &ss)
{
	int len = ss.GetLength();

	if (len > 0 && ss[0] == '(')
	{
		while (--len > 0)
		{
			if (ss[len] == ')')
				return ss.Mid(1, len-1);
			else if (ss[len] != ' ')
				break;
		}
	}
	return ss;
}
// Checks if an expression (in a string) is enclosed in parentheses and if so removes them
// and returns the expression (without parentheses) else just returns the input string.

Checks if an expression (in a string) is enclosed in parentheses and if so removes them
and returns the expression (without parentheses) else just returns the input string.
Checks if an expression ( in a string ) is enclosed in parentheses and if so removes them and returns the expression ( without parentheses ) else just returns the input string .
ExprStringType CCalcDlg::without_parens(const ExprStringType &ss)
{
	int len = ss.GetLength();
	if (len > 0 && ss[0] == '(')
	{
		while (--len > 0)
		{
			if (ss[len] == ')')
				return ss.Mid(1, len-1);
			else if (ss[len] != ' ')
				break;
		}
	}
	return ss;
}
ExprStringType CCalcDlg :: without_parens ( const ExprStringType & ss ) { int len = ss . GetLength ( ) ; if ( len > 0 && ss [ 0 ] == ' ' ) { while ( -- len > 0 ) { if ( ss [ len ] == ' ' ) return ss . Mid ( 1 , len - 1 ) ; else if ( ss [ len ] != ' ' ) break ; } } return ss ; }
Checks if an expression (in a string) is enclosed in parentheses and if so removes them
and returns the expression (without parentheses) else just returns the input string.
Checks if an expression ( in a string ) is enclosed in parentheses and if so removes them and returns the expression ( without parentheses ) else just returns the input string .