XmlWriterSettings.NewLineChars XmlWriterSettings.NewLineChars XmlWriterSettings.NewLineChars XmlWriterSettings.NewLineChars Property

定義

取得或設定用於分行符號的字元字串。Gets or sets the character string to use for line breaks.

public:
 property System::String ^ NewLineChars { System::String ^ get(); void set(System::String ^ value); };
public string NewLineChars { get; set; }
member this.NewLineChars : string with get, set
Public Property NewLineChars As String

屬性值

用於分行符號的字元字串。The character string to use for line breaks. 它可以設為任何字串值。This can be set to any string value. 不過,若要確保有效的 XML,您應該只指定有效的空白字元 (例如,空格字元、定位字元、歸位字元或換行符號)。However, to ensure valid XML, you should specify only valid white space characters, such as space characters, tabs, carriage returns, or line feeds. 預設值是\r\n (歸位字元、 新行)。The default is \r\n (carriage return, new line).

例外狀況

備註

此屬性只適用於XmlWriter執行個體的輸出文字的內容; 否則會忽略此設定。This property only applies to XmlWriter instances that output text content; otherwise, this setting is ignored. XmlWriter擲回例外狀況,如果分行符號字元會產生無效的 XML。The XmlWriter throws an exception if the line break characters would result in invalid XML.

適用於