在Processing 1.5.1中使用此代码时,我一直收到“Badly formed character constant”的错误。我想用我的String中的非破坏空格替换所有空格。任何帮助将不胜感激。
String newStr;
String S = "Hello there world"
char c = '\u00A0';
newStr = S.replace(' ', c);
答案 0 :(得分:1)
处理表示没有引号且前缀为0x的unicode试试这个:
String newStr;
String S = "Hello there world"
char c = 0x00A0;
newStr = S.replace(' ', c);