Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

String xml to write "<"

How to put a “<” in string.xml file i ve been searching for a solution for this problem but i cant any and im getting an error when i just put a simple < in the string file any ideas i saw this question but its not the same with mu problem How to put a "-" in string.xml file

here is my code

<string name="sp"> SP </string>
<string name="p1"> P1 </string>
<string name="p2"> P2 </string>
<string name="p3"> P3 </string>
<string name="p4"> P4 </string>
<string name="dialogprevious"> < </string> -- error here
<string name="dialognext"> > </string>
like image 200
Giant Avatar asked Nov 18 '25 22:11

Giant


1 Answers

Write < as entity-escaped &lt; (mnemonic: lt as in less than).

Similarly > as &gt; (greater than).

Further reading: http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

like image 59
laalto Avatar answered Nov 20 '25 16:11

laalto



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!