Method Evaluate
Evaluate(string, FieldComparisonOperator, string, bool, CultureInfo)
Evaluates a comparison whose left operand was not written quoted.
public static bool Evaluate(string left, FieldComparisonOperator comparison, string right, bool rightWasQuoted, CultureInfo culture)
Parameters
leftstringThe left operand text.
comparisonFieldComparisonOperatorThe operator.
rightstringThe right operand text.
rightWasQuotedboolIgnored. See the remarks.
cultureCultureInfoThe culture used to parse numeric operands.
Returns
- bool
The comparison result.
Remarks
Superseded by the overload taking leftWasQuoted. Quoting the left operand
is what forces a textual comparison; rightWasQuoted is accepted for
compatibility and has no effect, because the measurement (WQ-0007) showed wildcard
matching does not depend on the right operand's quoting. Callers that know whether the
left operand was quoted should use the six-argument overload — this one always assumes
it was not, and so compares "5.0" against 5 numerically where Word
compares them as text.
Exceptions
- ArgumentNullException
left,rightorcultureis null.
Evaluate(string, FieldComparisonOperator, string, bool, bool, CultureInfo)
Evaluates a comparison.
public static bool Evaluate(string left, FieldComparisonOperator comparison, string right, bool leftWasQuoted, bool rightWasQuoted, CultureInfo culture)
Parameters
leftstringThe left operand text.
comparisonFieldComparisonOperatorThe operator.
rightstringThe right operand text.
leftWasQuotedboolWhether the left operand was written quoted. A quoted left operand forces a textual comparison even when it parses as a number.
rightWasQuotedboolWhether the right operand was written quoted. Accepted for symmetry and currently not load-bearing: neither the numeric/textual choice nor wildcard matching depends on it.
cultureCultureInfoThe culture used to parse numeric operands. The currency symbol and separators accepted are this culture's, matching Word's locale sensitivity.
Returns
- bool
The comparison result.
Exceptions
- ArgumentNullException
left,rightorcultureis null.