这是表中日期值:
Dim s As String = "05-01,06-01,10-01"
Dim str As String = ""
Dim dt As String = ""
For Each r As Row In CurrentTable.Rows
dt = Format(r("日期").Month,"00") & "-" & Format(r("日期").Day,"00")
If s.Contains(dt) Then
str = str & " 第 " & r.Index & " 行: " & CStr(r("日期"))
End If
Next
MessageBox.Show(str)
如果是数组中的值:(这里数组比集合简单)
Dim s() As String = {"2013-02-03","2013-05-01","2014-06-01","2013-07-08","2013-10-01","2014-06-01"}
Dim str As String = ""
For i As Integer = 0 To s.Length - 1
If right(s(i),5) = "05-01" OrElse right(s(i),5) = "06-01" OrElse right(s(i),5) = "10-01" Then
str = str & " " & s(i)
End If
Next
MessageBox.Show(str)
[此贴子已经被作者于2013-5-5 11:27:45编辑过]