1

我正在尝试在我的 android 应用程序中创建 @sancorporation。我在 string.xml 中写过字符串,例如“<”string name="cor_name">sancorporation"<"/string>,但我需要这样的“<"string name="cor_name">@sancorporation"<"/string >。如何在android中获取特殊符号?

4

2 回答 2

2

使用@symble的ascii值是0040所以试试看

对于@sancorporation

          <string name="mytest">&#64;sancorporation</string>

           or 
           <string name="mytest">\u0040 sancorporation</string>
于 2013-07-14T14:40:00.157 回答
0

也许这会有所帮助

<string name="specialChar"> "@" </string>

你也可以试试这个

<string name="specialChar"> \@ </string>

编辑: 现在我注意到你想写@sanCorporation。

所以你可以在 string.xml 文件中使用它:

<string name="corp"> "@sanCorp" </string>
于 2013-07-14T14:39:41.757 回答