以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 怎样筛选获取表中某列中含有某个字符,并且字符最长的记录 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=56853) |
-- 作者:jswjyjf -- 发布时间:2014/9/13 17:22:00 -- 怎样筛选获取表中某列中含有某个字符,并且字符最长的记录 怎样筛选获取表中某列中含有某个字符,并且字符最长的记录 |
-- 作者:lsy -- 发布时间:2014/9/13 18:00:00 -- Dim s As String Dim t As Table = Tables("编程参考") Dim i As Integer For i = 0 To t.Rows.Count - 1 If t.Rows(i)("常用网址").Contains("baidu") Then s = t.Rows(i)("常用网址") End If Exit For Next For j As Integer = i To t.Rows.Count - 1 If Len(t.Rows(j)("常用网址")) > Len(s) AndAlso t.Rows(j)("常用网址").Contains("baidu") Then s = t.Rows(j)("常用网址") End If Next MessageBox.Show(s) [此贴子已经被作者于2014-9-13 18:01:34编辑过]
|