以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  求去掉字符串中小于一个值的所有项  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=66255)

--  作者:magangzmc
--  发布时间:2015/4/2 2:17:00
--  求去掉字符串中小于一个值的所有项

Dim NotWidthList As String = “600,800,300,500,200,740”

Dim Value As Integer = 500

 

想将NotWidthList中小于Value的值都去掉,NotWidthList的值动态获取的不是固定的。


--  作者:lsy
--  发布时间:2015/4/2 7:42:00
--  
Dim NotWidthList As String = "600,800,300,500,200,740"
Dim Value As Integer = 500
For Each s As String In NotWidthList.Split(",")
    If s < Value Then
        NotWidthList = NotWidthList.Replace(s,"")
    End If
Next
Output.Show(NotWidthList)