计算其字符长度,
actionscript代码
复制代码 代码如下:
for(var i:int=0;i<newstr.length;i++){
var char:string = newstr.substr(i,1);
if(/[^\x00-\xff]/g.test(char)){ //中文加10
screenlength = screenlength + 10;
}else{
screenlength = screenlength + 1;
}
}
文章分类: |
|
上传中....