Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put this symbol: " ' " (simple Quotation mark) in a XMLfile of android?

Tags:

android

xml

i am translating some text into Italian, an i got an error on this line of the XML of the strings.xml because the ' symbol on L'utente:

<string name="usernotexist">L'utente non esiste</string> 

how to solve that error?

like image 479
NullPointerException Avatar asked Feb 09 '11 12:02

NullPointerException


People also ask

How do you apostrophe an android string?

For Single Quote (') You can use \' in your string resources.

What is@ string in Android studio?

A string resource provides text strings for your application with optional text styling and formatting. There are three types of resources that can provide your application with strings: String. XML resource that provides a single string.

What is string XML file in Android?

String Array. XML resource that provides an array of strings. Quantity Strings (Plurals) XML resource that carries different strings for pluralization. All strings are capable of applying some styling markup and formatting arguments.


2 Answers

<string name="good_example">"This'll work"</string>
<string name="good_example_2">This\'ll also work</string>

Taken from the official documentation: http://developer.android.com/guide/topics/resources/string-resource.html

like image 115
Cristian Avatar answered Nov 01 '22 04:11

Cristian


Try this

<string name="dialog">L\'tutente non esiste </string>
like image 24
Pinki Avatar answered Nov 01 '22 03:11

Pinki