编译时控制台报出“error: Apostrophe not preceded by \ ”

来源:互联网 发布:建国大业 知乎 编辑:程序博客网 时间:2024/05/18 02:03

当我们用Eclipse环境开发Android项目,如果编译时控制台报出“error: Apostrophe not preceded by \ (”这种错误,那么多半是因为我们项目中的一个strings.xml文件里有一个string标签中的字符串含有’(单引号),我们只要在’之前加\进行转义就可以解决这个错误,比如把Can’t修改为Can\’t就可以了

这是华丽丽的 java 特点 ,见怪不怪 !





0 0
原创粉丝点击