Split字符串分割函数

非常非常常用的一个函数Split字符串分割函数。

Dim myTest
myTest = "aaa/bbb/ccc/ddd/eee/fff/ggg"

Dim arrTest
arrTest = Split(myTest , "/" , -1 , 1)

Dim i
For i = 0 to ubound(arrTest)
    print "arrTest(" & i & ") = " & arrTest(i)
Next


打印结果为:

arrTest(0) = aaa
arrTest(1) = bbb
arrTest(2) = ccc
arrTest(3) = ddd
arrTest(4) = eee
arrTest(5) = fff
arrTest(6) = ggg

我经常用来做一些赋值操作,也做一些对抓取到的数据进行分割处理的工作。

posted on 2014-06-20 19:55  信平  阅读(469)  评论(0编辑  收藏  举报