MemoryExtensions.AsSpan Méthode
Définition
Surcharges
AsSpan(String, Int32, Int32) |
Crée une étendue en lecture seule sur une chaîne.Creates a new read-only span over a string. |
AsSpan(String, Int32) |
Crée une étendue en lecture seule sur une partie de la chaîne cible à une position spécifiée jusqu’à la fin de la chaîne.Creates a new read-only span over a portion of the target string from a specified position to the end of the string. |
AsSpan(String) |
Crée une étendue en lecture seule sur une partie de la chaîne cible à une position spécifiée pour un nombre spécifié de caractères.Creates a new read-only span over a portion of the target string from a specified position for a specified number of characters. |
AsSpan<T>(ArraySegment<T>) |
Crée une étendue sur un segment de tableau cible.Creates a new span over a target array segment. |
AsSpan<T>(T[]) |
Crée une étendue sur un tableau cible.Creates a new span over a target array. |
AsSpan<T>(ArraySegment<T>, Index) |
Crée une étendue sur une partie du segment de tableau cible en commençant à un index spécifié et en se terminant à la fin du segment.Creates a new span over a portion of the target array segment beginning at a specified index and ending at the end of the segment. |
AsSpan<T>(ArraySegment<T>, Int32) |
Crée une étendue sur une partie d’un segment de tableau cible à une position spécifiée jusqu’à la fin du segment.Creates a new span over a portion of a target array segment from a specified position to the end of the segment. |
AsSpan<T>(ArraySegment<T>, Range) |
Crée une étendue sur une partie d’un segment de tableau cible à l’aide des index de début et de fin de plage.Creates a new span over a portion of a target array segment using the range start and end indexes. |
AsSpan<T>(T[], Index) |
Crée une étendue sur la partie du tableau cible défini par une valeur Index.Creates a new span over the portion of the target array defined by an Index value. |
AsSpan<T>(T[], Int32) |
Crée une étendue sur une partie du tableau cible en commençant à une position spécifiée jusqu’à la fin du tableau.Creates a new span over a portion of the target array starting at a specified position to the end of the array. |
AsSpan<T>(T[], Range) |
Crée une étendue sur une partie d’un tableau cible défini par une valeur Range.Creates a new span over a portion of a target array defined by a Range value. |
AsSpan<T>(ArraySegment<T>, Int32, Int32) |
Crée une étendue sur une partie d’un segment de tableau cible à une position spécifiée pour une longueur spécifiée.Creates a new span over a portion of a target array segment from a specified position for a specified length. |
AsSpan<T>(T[], Int32, Int32) |
Crée une étendue sur la partie du tableau cible en commençant à une position spécifiée pour une longueur spécifiée.Creates a new span over the portion of the target array beginning at a specified position for a specified length. |
AsSpan(String, Int32, Int32)
Crée une étendue en lecture seule sur une chaîne.Creates a new read-only span over a string.
public:
[System::Runtime::CompilerServices::Extension]
static ReadOnlySpan<char> AsSpan(System::String ^ text, int start, int length);
public static ReadOnlySpan<char> AsSpan (this string text, int start, int length);
static member AsSpan : string * int * int -> ReadOnlySpan<char>
<Extension()>
Public Function AsSpan (text As String, start As Integer, length As Integer) As ReadOnlySpan(Of Char)
Paramètres
- text
- String
Chaîne cible.The target string.
- start
- Int32
Index auquel commence cette section.The index at which to begin this slice.
- length
- Int32
Longueur souhaitée de la section.The desired length for the slice.
Retours
Représentation sous forme d’étendue en lecture seule de la chaîne.The read-only span representation of the string.
Exceptions
start
, length
ou start
+ length
n’est pas dans la plage de text
.start
, length
, or start
+ length
is not in the range of text
.
Remarques
Retourne default
lorsque text
est null
.Returns default
when text
is null
.
AsSpan(String, Int32)
Crée une étendue en lecture seule sur une partie de la chaîne cible à une position spécifiée jusqu’à la fin de la chaîne.Creates a new read-only span over a portion of the target string from a specified position to the end of the string.
public:
[System::Runtime::CompilerServices::Extension]
static ReadOnlySpan<char> AsSpan(System::String ^ text, int start);
public static ReadOnlySpan<char> AsSpan (this string text, int start);
static member AsSpan : string * int -> ReadOnlySpan<char>
<Extension()>
Public Function AsSpan (text As String, start As Integer) As ReadOnlySpan(Of Char)
Paramètres
- text
- String
Chaîne cible.The target string.
- start
- Int32
Index auquel commence cette section.The index at which to begin this slice.
Retours
Représentation sous forme d’étendue en lecture seule de la chaîne.The read-only span representation of the string.
Exceptions
text
a la valeur null
.text
is null
.
start
est inférieur à 0 ou supérieur à text.Length
.start
is less than 0 or greater than text.Length
.
AsSpan(String)
Crée une étendue en lecture seule sur une partie de la chaîne cible à une position spécifiée pour un nombre spécifié de caractères.Creates a new read-only span over a portion of the target string from a specified position for a specified number of characters.
public:
[System::Runtime::CompilerServices::Extension]
static ReadOnlySpan<char> AsSpan(System::String ^ text);
public static ReadOnlySpan<char> AsSpan (this string text);
static member AsSpan : string -> ReadOnlySpan<char>
<Extension()>
Public Function AsSpan (text As String) As ReadOnlySpan(Of Char)
Paramètres
- text
- String
Chaîne cible.The target string.
Retours
Représentation sous forme d’étendue en lecture seule de la chaîne.The read-only span representation of the string.
Remarques
Retourne default
lorsque text
est null
.Returns default
when text
is null
.
AsSpan<T>(ArraySegment<T>)
Crée une étendue sur un segment de tableau cible.Creates a new span over a target array segment.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static Span<T> AsSpan(ArraySegment<T> segment);
public static Span<T> AsSpan<T> (this ArraySegment<T> segment);
static member AsSpan : ArraySegment<'T> -> Span<'T>
<Extension()>
Public Function AsSpan(Of T) (segment As ArraySegment(Of T)) As Span(Of T)
Paramètres de type
- T
Type du segment de tableau.The type of the array segment.
Paramètres
- segment
- ArraySegment<T>
Segment de tableau à convertir.The array segment to convert.
Retours
Représentation sous forme d’étendue du segment de tableau.The span representation of the array segment.
AsSpan<T>(T[])
Crée une étendue sur un tableau cible.Creates a new span over a target array.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static Span<T> AsSpan(cli::array <T> ^ array);
public static Span<T> AsSpan<T> (this T[] array);
static member AsSpan : 'T[] -> Span<'T>
<Extension()>
Public Function AsSpan(Of T) (array As T()) As Span(Of T)
Paramètres de type
- T
Type de tableau.The type of the array.
Paramètres
- array
- T[]
Tableau à convertir.The array to convert.
Retours
Représentation sous forme d’étendue du tableau.The span representation of the array.
AsSpan<T>(ArraySegment<T>, Index)
Crée une étendue sur une partie du segment de tableau cible en commençant à un index spécifié et en se terminant à la fin du segment.Creates a new span over a portion of the target array segment beginning at a specified index and ending at the end of the segment.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static Span<T> AsSpan(ArraySegment<T> segment, Index startIndex);
public static Span<T> AsSpan<T> (this ArraySegment<T> segment, Index startIndex);
static member AsSpan : ArraySegment<'T> * Index -> Span<'T>
<Extension()>
Public Function AsSpan(Of T) (segment As ArraySegment(Of T), startIndex As Index) As Span(Of T)
Paramètres de type
- T
Type du segment de tableau.The type of the array segment.
Paramètres
- segment
- ArraySegment<T>
Segment de tableau cible.The target array segment.
- startIndex
- Index
Index à partir duquel commencer l’étendue.The index at which to begin the Span.
Retours
Représentation sous forme d’étendue du segment de tableau.The span representation of the array segment.
AsSpan<T>(ArraySegment<T>, Int32)
Crée une étendue sur une partie d’un segment de tableau cible à une position spécifiée jusqu’à la fin du segment.Creates a new span over a portion of a target array segment from a specified position to the end of the segment.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static Span<T> AsSpan(ArraySegment<T> segment, int start);
public static Span<T> AsSpan<T> (this ArraySegment<T> segment, int start);
static member AsSpan : ArraySegment<'T> * int -> Span<'T>
<Extension()>
Public Function AsSpan(Of T) (segment As ArraySegment(Of T), start As Integer) As Span(Of T)
Paramètres de type
- T
Type du segment de tableau.The type of the array segment.
Paramètres
- segment
- ArraySegment<T>
Segment de tableau cible.The target array segment.
- start
- Int32
Index à partir duquel commencer l’étendue.The index at which to begin the san.
Retours
Représentation sous forme d’étendue du segment de tableau.The span representation of the array segment.
Exceptions
La valeur segment
est covariante et le type du tableau n’est pas exactement T[]
.segment
is covariant, and the array's type is not exactly T[]
.
start
est inférieur à 0 ou supérieur à segment.Count
.start
is less than 0 or greater than segment.Count
.
Remarques
Retourne default
lorsque segment
est null
.Returns default
when segment
is null
.
AsSpan<T>(ArraySegment<T>, Range)
Crée une étendue sur une partie d’un segment de tableau cible à l’aide des index de début et de fin de plage.Creates a new span over a portion of a target array segment using the range start and end indexes.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static Span<T> AsSpan(ArraySegment<T> segment, Range range);
public static Span<T> AsSpan<T> (this ArraySegment<T> segment, Range range);
static member AsSpan : ArraySegment<'T> * Range -> Span<'T>
Paramètres de type
- T
Type du segment de tableau.The type of the array segment.
Paramètres
- segment
- ArraySegment<T>
Segment de tableau cible.The target array segment.
- range
- Range
Plage qui contient les index de début et de fin à utiliser pour découper le tableau.The range which has start and end indexes to use for slicing the array.
Retours
Représentation sous forme d’étendue du segment de tableau.The span representation of the array segment.
AsSpan<T>(T[], Index)
Crée une étendue sur la partie du tableau cible défini par une valeur Index.Creates a new span over the portion of the target array defined by an Index value.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static Span<T> AsSpan(cli::array <T> ^ array, Index startIndex);
public static Span<T> AsSpan<T> (this T[] array, Index startIndex);
static member AsSpan : 'T[] * Index -> Span<'T>
<Extension()>
Public Function AsSpan(Of T) (array As T(), startIndex As Index) As Span(Of T)
Paramètres de type
- T
Type de tableau.The array type.
Paramètres
- array
- T[]
Tableau à convertir.The array to convert.
- startIndex
- Index
Index de départ.The starting index.
Retours
Représentation sous forme d’étendue du tableau.The span representation of the array.
AsSpan<T>(T[], Int32)
Crée une étendue sur une partie du tableau cible en commençant à une position spécifiée jusqu’à la fin du tableau.Creates a new span over a portion of the target array starting at a specified position to the end of the array.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static Span<T> AsSpan(cli::array <T> ^ array, int start);
public static Span<T> AsSpan<T> (this T[] array, int start);
static member AsSpan : 'T[] * int -> Span<'T>
<Extension()>
Public Function AsSpan(Of T) (array As T(), start As Integer) As Span(Of T)
Paramètres de type
- T
Type de tableau.The type of the array.
Paramètres
- array
- T[]
Tableau à convertir.The array to convert.
- start
- Int32
Index initial à partir duquel le tableau sera converti.The initial index from which the array will be converted.
Retours
Représentation sous forme d’étendue du tableau.The span representation of the array.
AsSpan<T>(T[], Range)
Crée une étendue sur une partie d’un tableau cible défini par une valeur Range.Creates a new span over a portion of a target array defined by a Range value.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static Span<T> AsSpan(cli::array <T> ^ array, Range range);
public static Span<T> AsSpan<T> (this T[] array, Range range);
static member AsSpan : 'T[] * Range -> Span<'T>
Paramètres de type
- T
Type de tableau.The type of the array.
Paramètres
- array
- T[]
Tableau à convertir.The array to convert.
- range
- Range
Plage du tableau à convertir.The range of the array to convert.
Retours
Représentation sous forme d’étendue du tableau.The span representation of the array.
AsSpan<T>(ArraySegment<T>, Int32, Int32)
Crée une étendue sur une partie d’un segment de tableau cible à une position spécifiée pour une longueur spécifiée.Creates a new span over a portion of a target array segment from a specified position for a specified length.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static Span<T> AsSpan(ArraySegment<T> segment, int start, int length);
public static Span<T> AsSpan<T> (this ArraySegment<T> segment, int start, int length);
static member AsSpan : ArraySegment<'T> * int * int -> Span<'T>
<Extension()>
Public Function AsSpan(Of T) (segment As ArraySegment(Of T), start As Integer, length As Integer) As Span(Of T)
Paramètres de type
- T
Type du segment de tableau.The type of the array segment.
Paramètres
- segment
- ArraySegment<T>
Segment de tableau cible.The target array segment.
- start
- Int32
Index à partir duquel commencer l’étendue.The index at which to begin the span.
- length
- Int32
Nombre d’éléments dans l’étendue.The number of items in the span.
Retours
Représentation sous forme d’étendue du tableau.The span representation of the array.
Exceptions
La valeur segment
est covariante et le type du tableau n’est pas exactement T[]
.segment
is covariant, and the array's type is not exactly T[]
.
start
, length
ou start
+ length
n’est pas dans la plage de segment
.start
, length
, or start
+ length
is not in the range of segment
.
Remarques
Retourne default
lorsque segment
est null
.Returns default
when segment
is null
.
AsSpan<T>(T[], Int32, Int32)
Crée une étendue sur la partie du tableau cible en commençant à une position spécifiée pour une longueur spécifiée.Creates a new span over the portion of the target array beginning at a specified position for a specified length.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static Span<T> AsSpan(cli::array <T> ^ array, int start, int length);
public static Span<T> AsSpan<T> (this T[] array, int start, int length);
static member AsSpan : 'T[] * int * int -> Span<'T>
<Extension()>
Public Function AsSpan(Of T) (array As T(), start As Integer, length As Integer) As Span(Of T)
Paramètres de type
- T
Type de tableau.The type of the array.
Paramètres
- array
- T[]
Tableau cible.The target array.
- start
- Int32
Index à partir duquel commencer l’étendue.The index at which to begin the span.
- length
- Int32
Nombre d’éléments dans l’étendue.The number of items in the span.
Retours
Représentation sous forme d’étendue du tableau.The span representation of the array.
Exceptions
La valeur array
est covariante et le type du tableau n’est pas exactement T[]
".array
is covariant, and the array's type is not exactly T[]
".
start
, length
ou start
+ length
n’est pas dans la plage de text
.start
, length
, or start
+ length
is not in the range of text
.
Remarques
Retourne default
lorsque array
est null
.Returns default
when array
is null
.