当前位置: 技术问答>java相关
replace的使用
来源: 互联网 发布时间:2015-07-27
本文导语: 在我程序里有 keyword = keyword.replaceAll('1','中'); 编译的时候提示 bj114.java:51: unclosed character literal keyword = keyword.replaceAll('1','中'); ...
在我程序里有
keyword = keyword.replaceAll('1','中');
编译的时候提示
bj114.java:51: unclosed character literal
keyword = keyword.replaceAll('1','中');
^
bj114.java:51: illegal character: 177
keyword = keyword.replaceAll('1','中');
^
bj114.java:51: unclosed character literal
keyword = keyword.replaceAll('1','中');
^
bj114.java:51: ')' expected
keyword = keyword.replaceAll('1','中');
请问是问什么,应该怎么写,我的环境是linux+jdk 1.4
keyword = keyword.replaceAll('1','中');
编译的时候提示
bj114.java:51: unclosed character literal
keyword = keyword.replaceAll('1','中');
^
bj114.java:51: illegal character: 177
keyword = keyword.replaceAll('1','中');
^
bj114.java:51: unclosed character literal
keyword = keyword.replaceAll('1','中');
^
bj114.java:51: ')' expected
keyword = keyword.replaceAll('1','中');
请问是问什么,应该怎么写,我的环境是linux+jdk 1.4
|
中不是字符类型