Can I put & in my String resource ?

I try to write Confirm & Close in my String resources but I receive the following errors The entity name must immediately follow the '&' in the entity reference.

how can I fix that ?

Upvotes: 2

Views: 621

Answers (2)

Deepzz
Deepzz

Reputation: 4571

use this.......

<string name="confirm">Confirm &amp; Close</string>

Upvotes: 4

Overv
Overv

Reputation: 8529

Yes, but you have to use HTML encoding:

&amp;

That's because & denotes a character entity.

Upvotes: 2

Related Questions