「VB.net」Containsで配列の要素に指定の値があるか判定のサンプル
構文
Public Function Contains (value As String) As Boolean
サンプルコード
Module Module1 Sub Main() Dim cft() As String = {"AA01", "BB02", "CC03", "DD04"} Dim resA As Boolean = cft.Contains("AB02") Console.WriteLine(resA) Dim resB As Boolean = cft.Contains("DD04") Console.WriteLine(resB) End Sub End Module
結果
False
True