📄 as2stringplus.as
字号:
class AS2StringPlus {
private static var STR_DIC : String = "abcdefghijklmnopqrstuvwxyz";
private static var NUM_DIC : String = "1234567890";
private static var SIGN_DIC : String = "-_#%$+!";
public static var STRING : String = "string";
public static var NUMBER : String = "number";
public static var SIGN : String = "sign";
public static var STR_NUM : String = "str&num";
public static var STR_SIGN : String = "str&sign";
public static var NUM_SIGN : String = "num&sign";
public static var MIX_ALL : String = "mix";
public static function makeMark(length : Number,option : String ,lowCase : Boolean ) : String {
length=length==null?6:length;
option=option==null?"mix":option;
lowCase = lowCase==null?false:lowCase;
var dic : String = "";
var s : String = "";
var char : String = "";
switch(option) {
case STRING:
dic = STR_DIC;
break;
case NUMBER:
dic = NUM_DIC;
break;
case SIGN:
dic = SIGN_DIC;
break;
case STR_NUM:
dic = STR_DIC + NUM_DIC;
break;
case STR_SIGN:
dic = STR_DIC + SIGN_DIC;
break;
case NUM_SIGN:
dic = NUM_DIC + SIGN_DIC;
break;
case MIX_ALL:
dic = STR_DIC + NUM_DIC + SIGN_DIC;
break;
default:
break;
}
var len : Number = dic.length;
while(length > 0) {
char = dic.charAt(Math.floor(Math.random() * len));
s += lowCase ? char.toLowerCase() : char.toUpperCase();
length--;
}
return s;
}
public static function htmlTag2(s:String):String{
return s.split("<").join("<").split(">").join(">");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -