将字符串打乱输出

Dim i,mm,Str,StrPosition,NewStr
Str = "1234567890"
For i=1ToLen(Str)
    StrPosition = GetRandomMath(1,Len(Replace(Str,mm,"")))
    Str = Replace(Str,mm,"")
    mm = Mid(str,StrPosition,1)
    NewStr = NewStr & mm
Next
WScript.Echo "NewStr = " & NewStr

Function GetRandomMath(begin,over)
    Randomize
    GetRandomMath = Int((Rnd * (over - begin + 1)) + begin)
EndFunction

原文地址:https://www.cnblogs.com/futrueface/p/4123201.html