Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: how to put question mark in a string resource?

Tags:

Android doesn't allow strings containing '?' because it has special meaning in XML context. How do I encode this symbol in a string resource?

like image 729
Violet Giraffe Avatar asked Nov 25 '11 11:11

Violet Giraffe


People also ask

How do you put a question mark in a string in Java?

getString(R. string. questionMark); String delim4 = (questionMark);

Is question mark a string?

In a URL, the query starts with a question mark - the question mark is used as a separator, and is not part of the query string.

What does question mark mean in Android Studio?

The question mark means it's a reference to a resource value in the currently applied theme.

What is string resource in Android?

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. String Array.


1 Answers

Use a backslash.

Read more about escaping characters here.

like image 133
Charles Munger Avatar answered Oct 04 '22 23:10

Charles Munger