String.op_Inequality メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > String.op_Inequality メソッドの意味・解説 

String.op_Inequality メソッド

指定した 2 つString オブジェクトの値が異なかどうか判断します

名前空間: System
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Shared Operator <> ( _
    a As String, _
    b As String _
) As Boolean
J# では、オーバーロードされた演算子使用できません。
JScriptでは、 オーバーロードされた演算子使用できますが、新規に宣言することはできません。

パラメータ

a

String または null 参照 (Visual Basic では Nothing)。

b

String または null 参照 (Visual Basic では Nothing)。

戻り値
a の値が b の値と異な場合trueそれ以外場合false

解説解説
使用例使用例

等値演算子コード例次に示します

' Example for the String Inequality operator.
Imports System
Imports Microsoft.VisualBasic

Module InequalityOp
   
    Sub Main()
        Console.WriteLine( _
            "This example of the String Inequality operator"
 & _
            vbCrLf & "generates the following output."
 & vbCrLf)

        CompareAndDisplay("ijkl")
        CompareAndDisplay("ABCD")
        CompareAndDisplay("abcd")
    End Sub 'Main
       
    Sub CompareAndDisplay(Comparand As String)

        Dim Lower As String
 = "abcd"
          
        Console.WriteLine( _
            """{0}""
 <> ""{1}""
 ?  {2}", _
            Lower, Comparand, Lower <> Comparand)

    End Sub 'CompareAndDisplay
End Module 'InequalityOp

' This example of the String Inequality operator
' generates the following output.
' 
' "abcd" <> "ijkl" ?  True
' "abcd" <> "ABCD" ?  True
' "abcd" <> "abcd" ?  False
// Example for the String Inequality operator.
using System;

class InequalityOp 
{
    public static void Main()
 
    {
        Console.WriteLine( 
            "This example of the String Inequality operator\n" +
            "generates the following output.\n" );

        CompareAndDisplay( "ijkl" );
        CompareAndDisplay( "ABCD" );
        CompareAndDisplay( "abcd" );
    }

    static void CompareAndDisplay( String Comparand
 )
    {
        String  Lower = "abcd";

        Console.WriteLine( 
            "\"{0}\" != \"{1}\" ?  {2}",
            Lower, Comparand, Lower != Comparand );
    }
}

/*
This example of the String Inequality operator
generates the following output.

"abcd" != "ijkl" ?  True
"abcd" != "ABCD" ?  True
"abcd" != "abcd" ?  False
*/
// Example for the String Inequality operator.
using namespace System;
void CompareAndDisplay( String^ Comparand )
{
   String^ Lower = "abcd";
   Console::WriteLine( "\"{0}\" != \"{1}\" ?  {2}",
 Lower, Comparand, Lower != Comparand );
}

int main()
{
   Console::WriteLine( "This example of the String Inequality operator\n"
   "generates the following output.\n" );
   CompareAndDisplay( "ijkl" );
   CompareAndDisplay( "ABCD" );
   CompareAndDisplay( "abcd" );
}

/*
This example of the String Inequality operator
generates the following output.

"abcd" != "ijkl" ?  True
"abcd" != "ABCD" ?  True
"abcd" != "abcd" ?  False
*/
// Example for the String Inequality operator.
import System.*;

class InequalityOp
{
    public static void main(String[]
 args)
    {
        Console.WriteLine(("This example of the String Inequality operator\n"
 
            + "generates the following output.\n"));
        CompareAndDisplay("ijkl");
        CompareAndDisplay("ABCD");
        CompareAndDisplay("abcd");
    } //main

    static void CompareAndDisplay(String comparand)
    {
        String lower = "abcd";
        Console.WriteLine("\"{0}\" != \"{1}\" ?  {2}",
 lower, comparand, 
        System.Convert.ToString(!lower.equals(comparand)));
    } //CompareAndDisplay
} //InequalityOp

/*
This example of the String Inequality operator
generates the following output.

"abcd" != "ijkl" ?  True
"abcd" != "ABCD" ?  True
"abcd" != "abcd" ?  False
*/
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からString.op_Inequality メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からString.op_Inequality メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からString.op_Inequality メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

String.op_Inequality メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



String.op_Inequality メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS