以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 请教 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=44385) |
-- 作者:有点甜 -- 发布时间:2013/12/29 21:46:00 -- Dim fmt As String = "中国" Dim str As String = "中国,中国功夫,人名,幸福,中国" str = str.Replace(fmt & ",", "") If str.EndsWith("," & fmt) Then str = left(str, str.Length - fmt.Length - 1) End If msgbox(str)
|
-- 作者:blackzhu -- 发布时间:2013/12/30 8:19:00 -- Dim str As String = "中国,中国功夫,人名,幸福,中国" Dim fmt As String Dim Values() As String = str.Split(",") For Each Value As String In Values If Value.Contains("中国")=False Then \' fmt= Value.Replace(Value,"") Output.Show(Value) End If Next 试试这样
|