在string.xml文件中使用'

时间:2015-12-28 12:23:21

标签: android string apostrophe

我给app_name如下:

 <string name="app_name">My \'App</string>

使用撇号我在其中使用\。

但是,它仍然给我以下错误:

Error:(2) Apostrophe not preceded by \ (in My 'App)

因此,我从app_name中删除了',并将其简单地写为My App。 但是,它仍然给我同样的错误,我重新启动了android studio,清理了项目,甚至重新启动了我的系统,但是仍然遇到同样的错误。

1 个答案:

答案 0 :(得分:4)

替换你的行

 <string name="app_name">My \'App</string>

 <string name="app_name">My &#39;App</string>
相关问题