--随机生成字符串----@param {int} len -- 要随机的字符串长度----返回生成的字符串--@Return {String} rankStr --生成的随机字符串function UICommon.randomStr(len)math.randomseed(os.time())local rankStr = ""for i=1,len dolocal randNum = math.random(1,3)if randNum==1 thenrandNum=string.char(math.random(0,26)+65)elseif randNum==2 thenrandNum=string.char(math.random(0.26)+97)elserandNum=math.random(0,9)endrankStr=rankStr..randNumendreturn rankStrend
900字范文,内容丰富有趣,生活中的好帮手!