My Android Step-by-step tour------>android single quote problem in string resource Error:apostrophe not preceded by solution

Source: Internet
Author: User

Just in string string resource file, wrote a single quotation mark, an error, the wrong code is as follows

Error:apostrophe not preceded by \ (in Ouyangpeng ' s blog)
The resource files are as follows:

<?xml version= "1.0" encoding= "Utf-8"?><resources>    <string name= "Ouyang" >ouyangpeng ' s Blog </string>    <string name= "blog" > http://blog.csdn.net/ouyang_peng</string></resources>

There are two workarounds, as follows:

The first method: Enclose the string resource of single quotation marks with double quotation marks, as follows:

<string name= "Ouyang" > "Ouyangpeng ' s Blog" </string>

second method:   '   \ &NBSP; , this is done to avoid ambiguity, as follows:

<string name= "Ouyang" >ouyangpeng\ ' s blog </string>


Refer to the previous article: "My Android Advanced Tour------> Report error:apostrophe not preceded by \ Error Resolution"

(Address: http://blog.csdn.net/ouyang_peng/article/details/16939225)

==================================================================================================

Ouyangpeng welcome reprint, sharing with people is the source of progress!

Reprint please keep the original address : Http://blog.csdn.net/ouyang_peng

==================================================================================================

  



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

My Android Step-by-step tour------>android single quote problem in string resource Error:apostrophe not preceded by solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.