//去掉字串中的空格会车换行以及重复字符。
function del(str) {
str = str.split("");
str.sort();
var str2 = "", str3 = "\r\n ", char;
while (str.length>0) {
char = str.shift();
if (char != str2.substr(-1) && str3.indexOf(char) == -1) {
str2 += char;
}
}
return str2;
}
//--------主程序段----------
new _jh7086(100,1,300,330);
//文本输入框
//this.createTextField("in_out", 0, 50, 50, 300, 300);
with (in_out) {
type = "input";
border = true;
text = "在框内输入需要处理的字串\n然后在框外点击鼠标即可\n字符量大时请耐心等待";
}
//事件响应
this.onMouseUp = function() {
Selection.setSelection(0, in_out.length);
};
in_out.onKillFocus = function() {
in_out.text = del(in_out.text);
};
回复Comments
{commenttime}{commentauthor}
{CommentUrl}
{commentcontent}