码迷,mamicode.com
首页 > 其他好文 > 详细

探索Split函数第三位参数的用法

时间:2014-07-24 10:07:34      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   for   re   c   

Private Sub Form_Click()
    Dim c() As String
    c = Split("A,B,C,D,E", ",")
    For i = 0 To UBound(c)
        Print c(i)
    Next i
End Sub

运行效果:
A

B

C

D

E

Private Sub Form_Click()
    Dim c() As String
    c = Split("A,B,C,D,E", ",", 1)
    For i = 0 To UBound(c)
        Print c(i)
    Next i
End Sub

运行效果:

A,B,C,D,E

Private Sub Form_Click()
    Dim c() As String
    c = Split("A,B,C,D,E", ",",2)
    For i = 0 To UBound(c)
        Print c(i)
    Next i
End Sub

运行效果:
A

B,C,D,E

Private Sub Form_Click()
    Dim c() As String
    c = Split("A,B,C,D,E", ",", 3)
    For i = 0 To UBound(c)
        Print c(i)
    Next i
End Sub

运行效果:

A

B

C,D,E

总结:第三位参数代表将原字符串截成多少组字符串

探索Split函数第三位参数的用法,布布扣,bubuko.com

探索Split函数第三位参数的用法

标签:style   blog   color   for   re   c   

原文地址:http://www.cnblogs.com/Spacecup/p/3864701.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!