首页 > 其他 > 详细

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

时间:2014-07-24 10:07:34      阅读:367      评论:0      收藏:0      [点我收藏+]
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函数第三位参数的用法

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!