as3 区别中文 英文 数字

1)英文a-z是65-90,A-Z是97-112
2)数字是0-9是,48-57
3)上万的都是中文字符

var str:String = "hello world! 你好世界! 88!";
for (var i:int = 0; i < str.length; i++)
{
    trace(str.charAt(i), "-", str.charCodeAt(i));
}


/*输出:
h - 104
e - 101
l - 108
l - 108
o - 111
  - 32
w - 119
o - 111
r - 114
l - 108
d - 100
! - 33
  - 32
你 - 20320
好 - 22909
世 - 19990
界 - 30028
! - 33
  - 32
8 - 56
8 - 56
! - 33
*/

  

原文地址:https://www.cnblogs.com/dt1991/p/7998778.html