开发者

ChrW and AscW equivalent in Java (with Android SDK)

I need the function that return the Ascii code (actually Unicode number code), 开发者_Python百科as well as convert that code to the Unicode character one. They are ChrW and AscW in .NET. Ex: AscW("A") is 65, ChrW(65) is A.

Thanks.


Actually, those are from VB.NET, not actually the .NET Framework.

In Java a char is sort of a integral type. You can convert it to int and back:

String s = "abc";
char a = s.charAt(0);
int a_codepoint = (int)a;

char x = (char)120;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜