开发者

Technique to truncate vbscript variables

I need to take zip codes of various lengths from an existing variable and truncate them, when appropriate, to 5 characters.

Will this code work? If not, how can I accomplish this?

StateZip = split(splitAddr(1), " ")
S开发者_运维技巧tateZip = left(StateZip, 5)


splitAddr = "123456 12345 1234"
StateZip = split(splitAddr," ") 
For i = LBound(StateZip) To UBound(StateZip)
    StateZip(i) = left(StateZip(i), 5) 
    WScript.Echo StateZip(i)
Next
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜