如何插入特殊字符?

时间:2013-03-24 07:30:20

标签: java char

我需要插入一个分数角色,我该怎么做:

JOptionPane.showInputDialog("Please choose the number of cents,
"should be the symbol of cents");

应该有char的方法。

3 个答案:

答案 0 :(得分:4)

Java支持开箱即用的Unicode。只需将¢插入字符串文字即可。如果这不起作用,请尝试\u00A2

答案 1 :(得分:2)

Java支持Unicode源文件:

JOptionPane.showInputDialog("Please choose the number of ¢: ");应该有效!

答案 2 :(得分:1)

你是对的有一个特殊的命令,你可以使用,我猜它是169 ...但Java几乎接受任何特殊字符,所以你可以在网上找到并复制粘贴