XNamespace.Inequality(XNamespace, XNamespace) Operator
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.
Returns a value indicating whether two instances of XNamespace are not equal.
public:
static bool operator !=(System::Xml::Linq::XNamespace ^ left, System::Xml::Linq::XNamespace ^ right);
public static bool operator != (System.Xml.Linq.XNamespace left, System.Xml.Linq.XNamespace right);
public static bool operator != (System.Xml.Linq.XNamespace? left, System.Xml.Linq.XNamespace? right);
static member op_Inequality : System.Xml.Linq.XNamespace * System.Xml.Linq.XNamespace -> bool
Public Shared Operator != (left As XNamespace, right As XNamespace) As Boolean
Parameters
- left
- XNamespace
The first XNamespace to compare.
- right
- XNamespace
The second XNamespace to compare.
Returns
A Boolean that indicates whether left
and right
are not equal.
Examples
The following example shows a comparison of a XNamespace to a string.
XNamespace aw = "http://www.adventure-works.com";
Console.WriteLine(aw != "http://www.adventure-works.com");
Imports <xmlns="http://www.adventure-works.com">
Module Module1
Sub Main()
Dim aw As XNamespace = GetXmlNamespace()
Console.WriteLine(aw <> "http://www.adventure-works.com")
End Sub
End Module
This example produces the following output:
False
Remarks
The operator overloads ==
and !=
are provided to enable comparisons between XNamespace and string (for example, element.Name.Namespace == "http://www.adventure-works.com"
). The predefined reference equality operators in C# require one operand to be convertible to the type of the other through reference conversions only, and do not consider the implicit conversion from string to XNamespace.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기