请问在VB.net中怎样判断一个字符串是否是另一个字符串的子字符串? 如题所述,在VB.net中怎样判断一个字符串是否是另一个字符串的子字符串?请大家多多帮忙? __________________________________________________________________________ dim s1 as string = .......... dim s2 as string = ........... if s1.IndexOf(s2) > =0 then s2 is s1的子字符串 end if __________________________________________________________________________ 楼上暴强,我都不敢开口了,都不止是星星级的了 __________________________________________________________________________ 哇赛,,,巨侠来啦!!!! 多谢前辈指教!!! __________________________________________________________________________ 呵呵,好像不行啊,,以下是我的
代码,我想实现按输入的商品编号过滤
显示商品信息。。 Private Sub txtCmdyNum_KeyUp(ByVal sender As Object,ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtCmdyNum.KeyUp DataGridView1.Rows.Clear() For i = 0 To DataSetXFJL1.消费记录表.Rows.Count - 1 If DataSetXFJL1.消费记录表.Rows(i).Item(0).ToString.IndexOf(txtCmdyNum.Text) > = 0 Then DataGridView1.Rows.Insert(DataGridView1.Rows.Count,DataSetCmdyInf1.商品信息表.Rows(i).Item(0),DataSetCmdyInf1.商品信息表.Rows(i).Item(1),DataSetCmdyInf1.商品信息表.Rows(i).Item(2),DataSetCmdyInf1.商品信息表.Rows(i).Item(3),DataSetCmdyInf1.商品信息表.Rows(i).Item(4)) End If Next End Sub __________________________________________________________________________ 多谢楼上几位,我已经搞定了。。。原来是我自己粗心,将商品信息表写成了消费记录表了。。 不好意思啊!!! For i = 0 To DataSetXFJL1.消费记录表.Rows.Count - 1 If DataSetXFJL1.消费记录表.Rows(i).Item(0).ToString.IndexOf(txtCmdyNum.Text) > = 0 Then __________________________________________________________________________
原文链接:https://www.f2er.com/vb/263503.html