vbs字符串分割函数
vbs字符串分割函数
发布时间:2016-12-28 来源:查字典编辑
摘要:复制代码代码如下:FunctionCutAndJoin(sSource,iLong,sJoiner)DimI,NN=Len(sSource)...

复制代码 代码如下:

Function CutAndJoin(sSource, iLong, sJoiner)

Dim I, N

N = Len(sSource) / iLong

If(N <> Fix(N))Then N = Fix(N) + 1

For I = 0 To N - 1

CutAndJoin = CutAndJoin & Mid(sSource, I * iLong + 1, iLong) & sJoiner

Next

If(N > 0)Then CutAndJoin = Left(CutAndJoin, Len(CutAndJoin) - Len(sJoiner))

End Function

WScript.Echo(CutAndJoin("hello world!", 1, "$"))

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新vbs学习
热门vbs学习
脚本专栏子分类