Class StringExtensions
- Namespace
- Cuemon.Extensions.Xml.Linq
- Assembly
- Cuemon.Extensions.Xml.dll
Extension methods for the String class.
public static class StringExtensions
- Inheritance
-
StringExtensions
Methods
IsXmlString(String)
Determines whether the specified value
is a valid XML string.
public static bool IsXmlString(this string value)
Parameters
Returns
- Boolean
true
if the specifiedvalue
is a valid XML string; otherwise,false
.
TryParseXElement(String, LoadOptions, out XElement)
Tries to load an XElement from a value
that contains XML, optionally preserving white space and retaining line information.
public static bool TryParseXElement(this string value, LoadOptions options, out XElement result)
Parameters
value
StringThe String to extend.
options
LoadOptionsA LoadOptions that specifies white space behavior, and whether to load base URI and line information.
result
XElementWhen this method returns, it contains the XElement populated from the
value
that contains XML, if the conversion succeeded, or a null reference (Nothing in Visual Basic) if the conversion failed.
Returns
- Boolean
true
if thevalue
parameter was converted successfully; otherwise,false
.
TryParseXElement(String, out XElement)
Tries to load an XElement from a value
that contains XML.
public static bool TryParseXElement(this string value, out XElement result)
Parameters
value
StringThe String to extend.
result
XElementWhen this method returns, it contains the XElement populated from the
value
that contains XML, if the conversion succeeded, or a null reference (Nothing in Visual Basic) if the conversion failed.
Returns
- Boolean
true
if thevalue
parameter was converted successfully; otherwise,false
.