Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apostrophe not preceded by \

I have a string defined in an android application:

<string name="search_occurs">'{string}' occurs {times}</string>

This gives the error: Apostrophe not preceded by \ (in '{string}' occurs {times})

I've tried a number of things to fix this:

<string name="search_occurs">\'{string}\' occurs {times}</string> <string name="search_occurs">&apos;{string}&apos; occurs {times}</string> <string name="search_occurs"><![CDATA['{string}' occurs {times}]]></string> <string name="search_occurs"><![CDATA[\'{string}\' occurs {times}]]></string> 

I'm not able to get rid of the error. What am I missing?

like image 576
Frank Schnabel Avatar asked Mar 29 '13 14:03

Frank Schnabel


1 Answers

these should both work according to http://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling:

<string name="search_occurs">\'{string}\' occurs {times}</string> <string name="search_occurs">"'{string}' occurs {times}"</string> 
like image 182
John Boker Avatar answered Sep 20 '22 20:09

John Boker