XText Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the XText class.
Overloads
XText(String) |
Initializes a new instance of the XText class. |
XText(XText) |
Initializes a new instance of the XText class from another XText object. |
XText(String)
- Source:
- XText.cs
- Source:
- XText.cs
- Source:
- XText.cs
Initializes a new instance of the XText class.
public:
XText(System::String ^ value);
public XText (string value);
new System.Xml.Linq.XText : string -> System.Xml.Linq.XText
Public Sub New (value As String)
Parameters
Examples
The following example creates an element that contains a text node.
XElement root = new XElement("Root", "Some text");
Console.WriteLine(root);
Dim root As XElement = <Root>Some text</Root>
Console.WriteLine(root)
This example produces the following output:
<Root>Some text</Root>
Remarks
You typically do not create text nodes by using the XText constructors. When you pass text content when constructing an XElement, text nodes are automatically created.
See also
Applies to
XText(XText)
- Source:
- XText.cs
- Source:
- XText.cs
- Source:
- XText.cs
public:
XText(System::Xml::Linq::XText ^ other);
public XText (System.Xml.Linq.XText other);
new System.Xml.Linq.XText : System.Xml.Linq.XText -> System.Xml.Linq.XText
Public Sub New (other As XText)
Parameters
Remarks
This constructor is primarily used internally to make a deep copy of an XML tree.
See also
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈