计算其字符长度,
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;
}
}
| 文章分类: |
|
上传中....