TextEdit Struct
Describes the replacement of a range of characters of a text with another text, as the ApplyEdits methods apply it.
public readonly struct TextEdit : IEquatable<TextEdit>Remarks
An edit whose TextEdit.Length is 0 is an insertion: it puts TextEdit.Text before the character at TextEdit.Start, or at the end of the text when TextEdit.Start is the length of the text. An edit whose TextEdit.Text is empty is a deletion.
A TextEdit accepts any value of TextEdit.Start and TextEdit.Length. The ApplyEdits methods check both against the text they are called on.
The default value is the insertion of an empty text at index 0, which changes no text.
See also
- Implements
Constructors
| Name | Description |
|---|---|
| TextEdit(int, int, string) | Initializes a new instance of the TextEdit struct. |
TextEdit(int, int, string)
Properties
| Name | Description |
|---|---|
| Length | Gets the number of characters to replace. |
| Start | Gets the index of the first character to replace. |
| Text | Gets the text that replaces the characters. |
Length
Start
Text
Methods
| Name | Description |
|---|---|
| Equals(TextEdit) | Determines whether this edit and a specified edit are equal. |
| Equals(object?) | Indicates whether this instance and a specified object are equal. |
| GetHashCode() | Returns the hash code for this instance. |
Equals overloads
Equals(TextEdit)
Determines whether this edit and a specified edit are equal.
Parameters
otherTextEdit- The edit to compare with this edit.
Returns
bool true if the two edits have the same TextEdit.Start, the same TextEdit.Length, and the same TextEdit.Text, compared by ordinal; otherwise, false.
Equals(object?)
GetHashCode()
Operators
| Name | Description |
|---|---|
| operator ==(TextEdit, TextEdit) | Determines whether two specified TextEdit values are equal. |
| operator !=(TextEdit, TextEdit) | Determines whether two specified TextEdit values are different. |
operator ==(TextEdit, TextEdit)
Determines whether two specified TextEdit values are equal.
Parameters
Returns
bool true if a and b have the same TextEdit.Start, the same TextEdit.Length, and the same TextEdit.Text; otherwise, false.
operator !=(TextEdit, TextEdit)
Determines whether two specified TextEdit values are different.
Parameters
Returns
bool true if a and b differ in TextEdit.Start, in TextEdit.Length, or in TextEdit.Text; otherwise, false.