CharacterRange.Inequality(CharacterRange, CharacterRange) 연산자

정의

두 개의 CharacterRange 개체를 비교합니다. 두 First 개체의 Length 또는 CharacterRange 값이 같지 않은지 여부를 나타내는 값을 가져옵니다.

public:
 static bool operator !=(System::Drawing::CharacterRange cr1, System::Drawing::CharacterRange cr2);
public static bool operator != (System.Drawing.CharacterRange cr1, System.Drawing.CharacterRange cr2);
static member op_Inequality : System.Drawing.CharacterRange * System.Drawing.CharacterRange -> bool
Public Shared Operator != (cr1 As CharacterRange, cr2 As CharacterRange) As Boolean

매개 변수

cr1
CharacterRange

불일치 여부를 비교할 CharacterRange입니다.

cr2
CharacterRange

불일치 여부를 비교할 CharacterRange입니다.

반환

First 개체의 Length 또는 CharacterRange 값이 다르면 true이고, 그렇지 않으면 false입니다.

예제

다음 예제에서는 Inequality 메서드를 사용하는 방법을 보여 줍니다. 이 예제를 실행 하려면 Windows 폼에 붙여 넣습니다. 양식의 처리 Paint 이벤트 및 호출 합니다 CharacterRangeInequality 메서드에서 Paint 전달 하는 이벤트 처리 메서드를 e 으로 PaintEventArgs입니다.

private void CharacterRangeInequality()
{

    // Declare the string to draw.
    string message = "Strings or strings; that is the question.";

    // Compare the ranges for equality. The should not be equal.
    CharacterRange range1 =
        new CharacterRange(message.IndexOf("Strings"), "Strings".Length);
    CharacterRange range2 =
        new CharacterRange(message.IndexOf("string"), "strings".Length);

    if (range1 != range2)
        MessageBox.Show("The ranges are not equal.");
    else
        MessageBox.Show("The ranges are equal.");
}
Private Sub CharacterRangeInequality() 
    
    ' Declare the string to draw.
    Dim message As String = "Strings or strings; that is the question."
    
    ' Compare the ranges for equality. The should not be equal.
    Dim range1 As New CharacterRange(message.IndexOf("Strings"), "Strings".Length)
    Dim range2 As New CharacterRange(message.IndexOf("string"), "strings".Length)
    
    If range1 <> range2 Then
        MessageBox.Show("The ranges are not equal.")
    Else
        MessageBox.Show("The ranges are equal.")
    End If
End Sub

설명

메서드는 Inequality 메서드의 반대 값을 반환합니다 Equality .

이 연산자에 대 한 해당 메서드는 CharacterRange.Equals(Object)

적용 대상

추가 정보