MemoryExtensions.Replace Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Přetížení
| Replace<T>(Span<T>, T, T, IEqualityComparer<T>) | |
| Replace<T>(ReadOnlySpan<T>, Span<T>, T, T, IEqualityComparer<T>) | |
| Replace<T>(Span<T>, T, T) |
Nahradí všechny výskyty řetězcem |
| Replace<T>(ReadOnlySpan<T>, Span<T>, T, T) |
Zkopíruje |
Replace<T>(Span<T>, T, T, IEqualityComparer<T>)
- Zdroj:
- 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)
Parametry typu
- T
Parametry
- span
- Span<T>
- oldValue
- T
- newValue
- T
- comparer
- IEqualityComparer<T>
Platí pro
Replace<T>(ReadOnlySpan<T>, Span<T>, T, T, IEqualityComparer<T>)
- Zdroj:
- 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)
Parametry typu
- T
Parametry
- source
- ReadOnlySpan<T>
- destination
- Span<T>
- oldValue
- T
- newValue
- T
- comparer
- IEqualityComparer<T>
Platí pro
Replace<T>(Span<T>, T, T)
- Zdroj:
- MemoryExtensions.cs
- Zdroj:
- MemoryExtensions.cs
- Zdroj:
- MemoryExtensions.cs
Nahradí všechny výskyty řetězcem oldValuenewValue.
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)
Parametry typu
- T
Typ prvků v rozsahu.
Parametry
- span
- Span<T>
Rozsah, ve kterém mají být prvky nahrazeny.
- oldValue
- T
Hodnota, která má být nahrazena newValuehodnotou .
- newValue
- T
Hodnota, která má nahradit všechny výskyty .oldValue
Platí pro
Replace<T>(ReadOnlySpan<T>, Span<T>, T, T)
- Zdroj:
- MemoryExtensions.cs
- Zdroj:
- MemoryExtensions.cs
- Zdroj:
- MemoryExtensions.cs
Zkopíruje source do destinationa nahradí všechny výskyty oldValue řetězcem 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)
Parametry typu
- T
Typ prvků v rozpětích.
Parametry
- source
- ReadOnlySpan<T>
Rozsah, který chcete zkopírovat.
- destination
- Span<T>
Rozsah, do kterého mají být zkopírované a nahrazené hodnoty zapsány.
- oldValue
- T
Hodnota, která má být nahrazena newValuehodnotou .
- newValue
- T
Hodnota, která má nahradit všechny výskyty .oldValue
Výjimky
Rozpětí destination je kratší než source rozpětí.
-nebo- source a destination překrývají se, ale neodkazujte na stejné počáteční umístění.