WPF的xaml中特殊字符表示

直接看錶,描述很清晰

字符app

轉義字符less

備註spa

& (ampersand)string

&io

這個沒什麼特別的,幾乎全部的地方都須要使用轉義字符table

> (greater-than character)class

>test

在屬性(Attribute values)中必須進行轉義,在內容(Content)中 若是沒有<在>符號的前面,能夠不進行轉義,直接使用>coding

< (less-than character)rsa

&lt;

在屬性(Attribute values)中必須進行轉義,在內容(Content)中 若是沒有>在<符號的後面,能夠不進行轉義,直接使用<

" (straight quotation mark)

&quot;

在屬性(Attribute Values)中必須進行轉義,在內容(Content)中能夠直接使用,而不進行轉義。須要注意的是若是屬性使用'來定義屬性,那麼"能夠直接使用如

Text='test"test"test',反之若是是用」來定義屬性,那麼'能夠直接使用而不須要轉義字符,如Text="test'test"

' (single straight quotation mark)

&apos;

同上

(numeric character mappings)

&#[integer]; or &#x[hex];

能夠和字符集合映射,如&#100;(10進制)或者&#xff;(16進制)

回車:&#x000D;換行:&#x000A;Tab:&#x0009;空格:&#x0020;

(nonbreaking space)

&#160; (assuming UTF-8 encoding)

Flow Document的元素或者有Text屬性的元素,輸出不間斷空格

{

{}{

當{}使用的時候,{能夠直接使用(功能相似與string text=@"E:\test.txt";中的@)

相關文章
相關標籤/搜索