vbs字符串分割函數(shù)
更新時(shí)間:2010年11月28日 21:35:56 作者:
vbs字符串分割函數(shù),將字符中如入指定分割字符,需要的朋友可以參考下。
復(fù)制代碼 代碼如下:
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, "$"))
相關(guān)文章
Vbs實(shí)現(xiàn)監(jiān)測斷網(wǎng)就關(guān)機(jī)的實(shí)現(xiàn)代碼
這篇文章主要介紹了Vbs實(shí)現(xiàn)監(jiān)測斷網(wǎng)就關(guān)機(jī)的實(shí)現(xiàn)代碼,這個(gè)vbs腳本檢測網(wǎng)卡狀態(tài),如果斷網(wǎng)馬上強(qiáng)行關(guān)機(jī),需要的朋友可以參考下2023-01-01用vbscript實(shí)現(xiàn)在消息框中顯示一個(gè)超鏈接
用vbscript實(shí)現(xiàn)在消息框中顯示一個(gè)超鏈接...2007-04-04利用wscript執(zhí)行文件[包括可執(zhí)行exe文件]vbs腳本
利用wscript執(zhí)行文件[包括可執(zhí)行exe文件]vbs腳本...2007-02-02WMI 創(chuàng)建系統(tǒng)服務(wù)的實(shí)現(xiàn)代碼(Automatic)
需要注意的是啟動(dòng)模式,應(yīng)為“Automatic”,而不是“Auto”2013-07-07