Class TextEdit
Denotes an edit for text
public class TextEdit
- Inheritance
-
TextEdit
- Inherited Members
Constructors
TextEdit(ParsePosition, ParsePosition, string[])
Creates a new text edit
public TextEdit(ParsePosition start, ParsePosition end, string[] newText)
Parameters
start
ParsePositionthe start of the edit
end
ParsePositionthe end of the edit
newText
string[]the new text inserted between start and end
Exceptions
- ArgumentException
thrown if start is after end
Properties
End
Gets the end of the edit
public ParsePosition End { get; }
Property Value
NewText
Gets the new text inserted between start and end
public string[] NewText { get; }
Property Value
- string[]
Start
Gets the start of the edit
public ParsePosition Start { get; }
Property Value
Methods
Apply(string[])
Applies the text edit to the given input
public string[] Apply(string[] input)
Parameters
input
string[]an input array of string lines
Returns
- string[]
a text array including the changes
UpdatePosition(ref ParsePosition)
Updates the position after applying this edit. Only Updates the Postion if it is fully after the Edit.
public void UpdatePosition(ref ParsePosition position)
Parameters
position
ParsePositionThe position to update.