开发者

square root character/symbol

I was wondering what the character code of th开发者_如何学JAVAe square root symbol is in java? That is, I want to be able to print a square root sign on screen inside a string of other characters, or as the label on a button.


Take a look at the Unicode character charts at http://www.unicode.org/charts/

See also http://www.google.com/search?q=square+root+character - you might find what you're looking for as the very first hit...


I am sure it's \u221A. Try it out or try googling it, and you might end up with something else (I mean a list of others).

EDIT: This would be helpful --> https://www.fileformat.info/info/unicode/char/search.htm


I found it. click here, this site has more unicode mathematical symbols than I was previously aware of. On the right of the page is what you want, its a hexidecimal number, here's how you would get the unicode character from the hexidecimal number in java.

char[] LESS_THAN = Character.toChars(0x3c);

Basically you're replacing the two symbols at the beginning (I forgot what they were already) with a 0 and passing it into that method. I believe 0x003c is the same value, 60 I think but I'm probably wrong about that, and I don't think its case sensitive so a capital 'c' should work as well. Hope that helped, good luck.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜