Sdílet prostřednictvím


PSConsoleReadLine.Replace Method

Definition

Replace some text at the given position. Supports undo.

public static void Replace (int start, int length, string replacement, Action<ConsoleKeyInfo?,object> instigator = default, object instigatorArg = default);
static member Replace : int * int * string * Action<Nullable<ConsoleKeyInfo>, obj> * obj -> unit
Public Shared Sub Replace (start As Integer, length As Integer, replacement As String, Optional instigator As Action(Of Nullable(Of ConsoleKeyInfo), Object) = Nothing, Optional instigatorArg As Object = Nothing)

Parameters

start
Int32

The start position to replace

length
Int32

The length to replace

replacement
String

The replacement text

instigator
Action<Nullable<ConsoleKeyInfo>,Object>

The action that initiated the replace (used for undo)

instigatorArg
Object

The argument to the action that initiated the replace (used for undo)

Applies to