System.String.op_Inequality Method

Determines whether two specified strings have different values.

Syntax

public static bool operator!= (string a, string b)

See Also

string.Equals(object)

Parameters

a
The first string to compare, or null.
b
The second string to compare, or null.

Returns

true if the value of a is different from the value of b; otherwise, false.

Remarks

The string.op_Inequality(string, string) method defines the operation of the inequality operator for the string class.

This operator is implemented using the string.Equals(object) method, which means the comparands are tested for a combination of reference and value equality. This operator performs an ordinal comparison.

Note:

The Visual Basic compiler does not resolve the inequality operator as a call to the string.op_Inequality(string, string) method. Instead, the inequality operator wraps a call to the Microsoft.VisualBasic.CompilerServices.Operators.CompareString(string, string, bool) method.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0