If i try to do things like this, it doesn't work... (empty string or no resource type error)
<string name="make_sales_order">FAIRE L'ORDRE DE VENTE </string>
how to use apostrophe character in android string xml.any ideas?
For Single Quote (') You can use \' in your string resources.
String. xml file contains all the strings which will be used frequently in Android project. String. xml file present in the values folder which is sub folder of res folder in project structure.In Android Studio, we have many Views such as TextView,Button,EditText,CheckBox,RadioButton etc.
1. For Single Quote (')
You can use \'
in your string resources.
or
You can can enclose the string in double quotes. For example:
"This'll work"
will simply become This'll work
once parsed
2. For double quote (")
"message \"quote string 1\" and \"quote string 2\" end message"
3. To represent in views xml (eg layout.xml), you have to use HTML character entities (like ")
"message "quoted string 1" and "quoted string 2" end message"
Though Android Studio in particular will complain about hardcoded strings and tell you to use a string resource in layout files instead of course!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With