以文本方式查看主题

-  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=114130)

--  作者:奶粉大王
--  发布时间:2018/1/29 16:23:00
--  [求助][原创]关于字符串分割的问题
例:如何将“0102030405060708080910” 这样的字符串转换为“01,02,03,04,05,06,07,08,08,09,10” 的格式,以便分割为数组?
--  作者:有点甜
--  发布时间:2018/1/29 17:14:00
--  
Dim str As String = "0102030405060708080910"
Dim nstr As String = ""
For i As Integer = 0 To str.length-1
    If i Mod 2 = 0 Then
        nstr &= "," & str(i)
    Else
        nstr &= str(i)
    End If
Next
msgbox(nstr.trim(","))