一个字符串转换为C $ CS ASCII $和背部在Flash [英] Convert a string to ASCII codes and back in Flash

查看:148
本文介绍了一个字符串转换为C $ CS ASCII $和背部在Flash的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在AS2你有功能 ORD() CHR()其具体转换ASCII codeS他们的字符串等效。

In AS2 you had the functions ord() and chr() which specifically converted ASCII codes to their string equivalents.

然而,在AS3, String.char $ C $猫() String.fromChar code()工作和UNI code值。

However in AS3, String.charCodeAt() and String.fromCharCode() work with Unicode values.

有没有办法将字符串字符转换为其对应的ASCII码,后?

Is there any way to convert a string character to its ASCII equivalent and back?

推荐答案

嗯,我找到了答案,它很奇怪。

Well I found the answer, and its quite strange.

通常的所谓的统一code的功能似乎与ASCII值,以正常工作。

The usual so called "Unicode" functions appear to work with ASCII values as well.

trace(String.fromCharCode(65))  // "A"
trace(("A").charCodeAt(0))      // 65

这篇关于一个字符串转换为C $ CS ASCII $和背部在Flash的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆