square root character/symbol

前端 未结 3 1807
说谎
说谎 2020-12-19 23:14

I was wondering what the character code of the 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 chara

相关标签:
3条回答
  • 2020-12-19 23:47

    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...

    0 讨论(0)
  • 2020-12-19 23:52

    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 讨论(0)
  • 2020-12-20 00:06

    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

    0 讨论(0)
提交回复
热议问题