如何添加<和>在android strings.xml中

如何添加<和>在android strings.xml中

问题描述:

我需要在string.xml中添加< string name ="name_hint"><给定名称></string> .为了做到这一点,转义序列是什么?要添加的字符串是<给定名称>

I need to add <string name="name_hint"><Given Name></string> in strings.xml. What is the escape sequence in order to do that? The string to be added is <Given Name>

对于小于符号使用& lt; ,对于大于符号使用& gt .所以在这里您需要替换为:

Use &lt; for less than symbol and &gt; for greater than symbol. so here you need to replace like:

<string name="name_hint">&lt;Given Name&gt;</string>