StringSegment.Implicit Operator

Definition

Overloads

Implicit(StringSegment to ReadOnlyMemory<Char>)

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

Creates a see ReadOnlyMemory<T> from the given StringSegment.

C#
public static implicit operator ReadOnlyMemory<char> (Microsoft.Extensions.Primitives.StringSegment segment);

Parameters

segment
StringSegment

The StringSegment to convert to a ReadOnlyMemory<T>.

Returns

Applies to

.NET 9 (package-provided) 和其他版本
产品 版本
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

Implicit(StringSegment to ReadOnlySpan<Char>)

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

Creates a see ReadOnlySpan<T> from the given StringSegment.

C#
public static implicit operator ReadOnlySpan<char> (Microsoft.Extensions.Primitives.StringSegment segment);

Parameters

segment
StringSegment

The StringSegment to convert to a ReadOnlySpan<T>.

Returns

Applies to

.NET 9 (package-provided) 和其他版本
产品 版本
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

Implicit(String to StringSegment)

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

Creates a new StringSegment from the given String.

C#
public static implicit operator Microsoft.Extensions.Primitives.StringSegment (string? value);

Parameters

value
String

The String to convert to a StringSegment.

Returns

Applies to

.NET 9 (package-provided) 和其他版本
产品 版本
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)