以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  如何之留一个逗号  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=100007)

--  作者:lyfxybc
--  发布时间:2017/5/2 18:39:00
--  如何之留一个逗号

A,,,B,C,,,,,,C,,,,D,D,,,,,D,,,D,

 

变为啊,A,B,C,C,D,D,D,D


--  作者:2900819580
--  发布时间:2017/5/2 19:31:00
--  
Dim s As String = "A,,,B,C,,,,,,C,,,,D,D,,,,,D,,,D,"
Dim st() As String
st = s.Split(",")
Dim v As String
For i As Integer = 0 To st.Length -1

If st(i) > "" Then 
If v > "" Then v = V & ","
v = v & st(i)
End If
    
Next
MessageBox.Show(v)

--  作者:lyfxybc
--  发布时间:2017/5/2 19:53:00
--  

谢谢