MemoryExtensions.Replace Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Overload
| Replace<T>(Span<T>, T, T, IEqualityComparer<T>) | |
| Replace<T>(ReadOnlySpan<T>, Span<T>, T, T, IEqualityComparer<T>) | |
| Replace<T>(Span<T>, T, T) |
Sostituisce tutte le occorrenze di |
| Replace<T>(ReadOnlySpan<T>, Span<T>, T, T) |
Copia |
Replace<T>(Span<T>, T, T, IEqualityComparer<T>)
- Origine:
- MemoryExtensions.cs
public static void Replace<T>(this Span<T> span, T oldValue, T newValue, System.Collections.Generic.IEqualityComparer<T>? comparer = default);
static member Replace : Span<'T> * 'T * 'T * System.Collections.Generic.IEqualityComparer<'T> -> unit
<Extension()>
Public Sub Replace(Of T) (span As Span(Of T), oldValue As T, newValue As T, Optional comparer As IEqualityComparer(Of T) = Nothing)
Parametri di tipo
- T
Parametri
- span
- Span<T>
- oldValue
- T
- newValue
- T
- comparer
- IEqualityComparer<T>
Si applica a
Replace<T>(ReadOnlySpan<T>, Span<T>, T, T, IEqualityComparer<T>)
- Origine:
- MemoryExtensions.cs
public static void Replace<T>(this ReadOnlySpan<T> source, Span<T> destination, T oldValue, T newValue, System.Collections.Generic.IEqualityComparer<T>? comparer = default);
static member Replace : ReadOnlySpan<'T> * Span<'T> * 'T * 'T * System.Collections.Generic.IEqualityComparer<'T> -> unit
<Extension()>
Public Sub Replace(Of T) (source As ReadOnlySpan(Of T), destination As Span(Of T), oldValue As T, newValue As T, Optional comparer As IEqualityComparer(Of T) = Nothing)
Parametri di tipo
- T
Parametri
- source
- ReadOnlySpan<T>
- destination
- Span<T>
- oldValue
- T
- newValue
- T
- comparer
- IEqualityComparer<T>
Si applica a
Replace<T>(Span<T>, T, T)
- Origine:
- MemoryExtensions.cs
- Origine:
- MemoryExtensions.cs
- Origine:
- MemoryExtensions.cs
Sostituisce tutte le occorrenze di oldValue con newValue.
public:
generic <typename T>
where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
static void Replace(Span<T> span, T oldValue, T newValue);
public static void Replace<T>(this Span<T> span, T oldValue, T newValue) where T : IEquatable<T>;
static member Replace : Span<'T (requires 'T :> IEquatable<'T>)> * 'T * 'T -> unit (requires 'T :> IEquatable<'T>)
<Extension()>
Public Sub Replace(Of T As IEquatable(Of T)) (span As Span(Of T), oldValue As T, newValue As T)
Parametri di tipo
- T
Tipo degli elementi nell'intervallo.
Parametri
- span
- Span<T>
Intervallo in cui devono essere sostituiti gli elementi.
- oldValue
- T
Valore da sostituire con newValue.
- newValue
- T
Valore da sostituire tutte le occorrenze di oldValue.
Si applica a
Replace<T>(ReadOnlySpan<T>, Span<T>, T, T)
- Origine:
- MemoryExtensions.cs
- Origine:
- MemoryExtensions.cs
- Origine:
- MemoryExtensions.cs
Copia source in destination, sostituendo tutte le occorrenze di oldValue con newValue.
public:
generic <typename T>
where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
static void Replace(ReadOnlySpan<T> source, Span<T> destination, T oldValue, T newValue);
public static void Replace<T>(this ReadOnlySpan<T> source, Span<T> destination, T oldValue, T newValue) where T : IEquatable<T>;
static member Replace : ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> * Span<'T (requires 'T :> IEquatable<'T>)> * 'T * 'T -> unit (requires 'T :> IEquatable<'T>)
<Extension()>
Public Sub Replace(Of T As IEquatable(Of T)) (source As ReadOnlySpan(Of T), destination As Span(Of T), oldValue As T, newValue As T)
Parametri di tipo
- T
Tipo degli elementi nell'intervallo.
Parametri
- source
- ReadOnlySpan<T>
Intervallo da copiare.
- destination
- Span<T>
Intervallo in cui devono essere scritti i valori copiati e sostituiti.
- oldValue
- T
Valore da sostituire con newValue.
- newValue
- T
Valore da sostituire tutte le occorrenze di oldValue.
Eccezioni
L'intervallo destination è più breve dell'intervallo source .
-o- source e destination sovrapporre ma non fare riferimento alla stessa posizione iniziale.