C# String Inequality
Description
String Inequality
determines whether two specified
strings have different values.
Syntax
String.Inequality
has the following syntax.
public static bool operator !=(
string a,
string b
)
Parameters
String.Inequality
has the following parameters.
a
- The first string to compare, or null.b
- The second string to compare, or null.
Returns
String.Inequality
method returns true if the value of a is different from the value of b; otherwise, false.
Example
The following example demonstrates the inequality operator.
/*from w w w . j av a 2s. c o m*/
using System;
class EqualityOp
{
public static void Main()
{
String Lower = "abcd";
Console.WriteLine( Lower != "abcd");
}
}
The code above generates the following result.