以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 关于Contains (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=111137) |
-- 作者:晕了快扶我 -- 发布时间:2017/12/15 18:07:00 -- 关于Contains Dim s As String = "张培,张柳" Dim s1 As String = "张柳" If s.Contains(s1) =True s = s.Trim(s1) End If output.show(s) 运行的结果是 培,张柳 我要的是"张培,"这个怎么整,看半天没看明白contains的用法 |
-- 作者:有点甜 -- 发布时间:2017/12/15 18:15:00 -- Dim s As String = "张培,张柳" Dim ls As new List(of String) ls.AddRange(s.Split(",")) Dim s1 As String = "张柳" ls.Remove(s1) output.show(String.Join(",", ls.ToArray)) |