[英]Apostrophe s in XML string file
根據 android 的文檔,我嘗試了兩種方法,如下所示:
<string name="tc">use of any of Company\'s services</string>
<string name="tc">use of any of Company's services</string>
但它給出了錯誤:
AAPT: error: unescaped apostrophe in string
我正在使用 Android studio 4.1.2 請幫幫我。
'
是在 XML 中轉義'
的常用方法。 也許這對你有用?
作為參考可能很有趣: https://stackoverflow.com/a/1091953/9712270
第一種方法是正確的
<string name="tc">use of any of Company\'s services</string>
在撇號之前只需要這個“”。 如果沒有其他字符串存在此問題,它應該可以工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.