求去掉字符串前面的0的函数
VBS中是否有去掉字符串前面的0的函数,如 "0012321312"我要得到“12321312”
如 "000012321312"我要得到“12321312”
有什么好方法吗? CLng(a) 回复 1# hanjj
如下:Dim str
str = "000120203"
msgbox myStr(str)
Function myStr(oString)
Dim oStr , StrLen , i
oStr = oString
StrLen = len(oStr)
For i = 1 To StrLen
If mid(oStr,1,1) = "0" Then
oStr = mid(oStr,2)
End If
Next
myStr = oStr
End Function
页:
[1]