StringSegment.Equals Method

Definition

Overloads

Equals(StringSegment, StringSegment, StringComparison)

Determines whether two specified StringSegment objects have the same value. A parameter specifies the culture, case, and sort rules used in the comparison.

Equals(String, StringComparison)

Checks if the specified String is equal to the current StringSegment.

Equals(StringSegment, StringComparison)

Indicates whether the current object is equal to another object of the same type.

Equals(StringSegment)

Indicates whether the current object is equal to another object of the same type.

Equals(Object)

Indicates whether the current object is equal to another object of the same type.

Equals(String)

Checks if the specified String is equal to the current StringSegment.

Equals(StringSegment, StringSegment, StringComparison)

Source:
StringSegment.cs
Source:
StringSegment.cs
Source:
StringSegment.cs

Determines whether two specified StringSegment objects have the same value. A parameter specifies the culture, case, and sort rules used in the comparison.

C#
public static bool Equals(Microsoft.Extensions.Primitives.StringSegment a, Microsoft.Extensions.Primitives.StringSegment b, StringComparison comparisonType);

Parameters

a
StringSegment

The first StringSegment to compare.

b
StringSegment

The second StringSegment to compare.

comparisonType
StringComparison

One of the enumeration values that specifies the rules for the comparison.

Returns

true if the objects are equal; otherwise, false.

Applies to

.NET 10 (package-provided) et autres versions
Produit Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)

Equals(String, StringComparison)

Source:
StringSegment.cs
Source:
StringSegment.cs
Source:
StringSegment.cs

Checks if the specified String is equal to the current StringSegment.

C#
public bool Equals(string? text, StringComparison comparisonType);

Parameters

text
String

The String to compare with the current StringSegment.

comparisonType
StringComparison

One of the enumeration values that specifies the rules to use in the comparison.

Returns

true if the specified String is equal to the current StringSegment; otherwise, false.

Exceptions

text is null.

Applies to

.NET 10 (package-provided) et autres versions
Produit Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)

Equals(StringSegment, StringComparison)

Source:
StringSegment.cs
Source:
StringSegment.cs
Source:
StringSegment.cs

Indicates whether the current object is equal to another object of the same type.

C#
public bool Equals(Microsoft.Extensions.Primitives.StringSegment other, StringComparison comparisonType);

Parameters

other
StringSegment

An object to compare with this object.

comparisonType
StringComparison

One of the enumeration values that specifies the rules to use in the comparison.

Returns

true if the current object is equal to other; otherwise, false.

Applies to

.NET 10 (package-provided) et autres versions
Produit Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)

Equals(StringSegment)

Source:
StringSegment.cs
Source:
StringSegment.cs
Source:
StringSegment.cs

Indicates whether the current object is equal to another object of the same type.

C#
public bool Equals(Microsoft.Extensions.Primitives.StringSegment other);

Parameters

other
StringSegment

An object to compare with this object.

Returns

true if the current object is equal to other; otherwise, false.

Implements

Applies to

.NET 10 (package-provided) et autres versions
Produit Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)

Equals(Object)

Source:
StringSegment.cs
Source:
StringSegment.cs
Source:
StringSegment.cs

Indicates whether the current object is equal to another object of the same type.

C#
public override bool Equals(object? obj);

Parameters

obj
Object

An object to compare with this object.

Returns

true if the current object is equal to obj; otherwise, false.

Applies to

.NET 10 (package-provided) et autres versions
Produit Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)

Equals(String)

Source:
StringSegment.cs
Source:
StringSegment.cs
Source:
StringSegment.cs

Checks if the specified String is equal to the current StringSegment.

C#
public bool Equals(string? text);

Parameters

text
String

The String to compare with the current StringSegment.

Returns

true if the specified String is equal to the current StringSegment; otherwise, false.

Implements

Applies to

.NET 10 (package-provided) et autres versions
Produit Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)