在安卓開發(fā)中我們經(jīng)常會遇到一些特殊字符,這些特殊字符在程序中無法直接寫,那么如何顯示這些字符呢?這里就需要使用轉(zhuǎn)義字符,所有編程語言,擁有轉(zhuǎn)義字符的原因基本上是兩點(diǎn):
一炼团、使用轉(zhuǎn)義字符來表示字符集中定義的字符扬蕊,比如ASCll里面的控制字符及回車換行等字符况鸣,這些字符都沒有現(xiàn)成的文字代
號妻率。所以只能用轉(zhuǎn)義字符來表示 囊榜。
二舅柜、某一些特定的字符在編輯語言中被定義為特殊用途的字符瞒窒。這些字符由于被定義為特殊用途完丽,它們失去了原有的意義恋技。
以下為部分XML標(biāo)志符的數(shù)字和字符串轉(zhuǎn)義符:
下面的字符在 [XML]中被定義為 空白(whitespace)字符:
空格 ( )
Tab ( )
回車 (
)
換行 (
)
---?---未使用Unused
---Space
!!---驚嘆號Exclamation mark
"""雙引號Quotation mark
---數(shù)字標(biāo)志Number sign
$$---美元標(biāo)志Dollar sign
%%---百分號Percent sign
&&&Ampersand
''---單引號Apostrophe
((---小括號左邊部分Left parenthesis
))---小括號右邊部分Right parenthesis
**---星號Asterisk
++---加號Plus sign
,,---逗號Comma
-----連字號Hyphen
..---句號Period (fullstop)
//---斜杠Solidus (slash)
00---數(shù)字0 Digit 0
11---數(shù)字1 Digit 1
22---數(shù)字2 Digit 2
33---數(shù)字3 Digit 3
44---數(shù)字4 Digit 4
55---數(shù)字5 Digit 5
66---數(shù)字6 Digit 6
77---數(shù)字7 Digit 7
88---數(shù)字8 Digit 8
99---數(shù)字9 Digit 9
::---冒號Colon
;;---分號Semicolon
<<<小于號Less than
==---等于符號Equals sign
大于號Greater than
空格Nonbreaking space
???Inverted exclamation
¢¢¢貨幣分標(biāo)志Cent sign
£££英鎊標(biāo)志Pound sterling
¤¤¤通用貨幣標(biāo)志General currency sign
¥¥¥日元標(biāo)志Yen sign
||| or &brkbar;斷豎線Broken vertical bar
§§§分節(jié)號Section sign
¨¨¨ or ¨變音符號Umlaut
???版權(quán)標(biāo)志Copyright
aaaFeminine ordinal
???Left angle quote, guillemet left
??¬Not sign
--Soft hyphen
???注冊商標(biāo)標(biāo)志Registered trademark
ˉˉˉ or &hibar;長音符號Macron accent
°°°度數(shù)標(biāo)志Degree sign
±±±加或減Plus or minus
222上標(biāo)2 Superscript two
333上標(biāo)3 Superscript three
′′′尖重音符Acute accent
μμμMicro sign
???Paragraph sign
···Middle dot
???Cedilla
111上標(biāo)1 Superscript one
oooMasculine ordinal
???Right angle quote, guillemet right
???四分之一Fraction one-fourth
???二分之一Fraction one-half
???四分之三Fraction three-fourths
???Inverted question mark
àààCapital A, grave accent
áááCapital A, acute accent
???Capital A, circumflex
???Capital A, tilde
???Capital A, di?esis / umlaut
???Capital A, ring
???Capital AE ligature
???Capital C, cedilla
èèèCapital E, grave accent
éééCapital E, acute accent