TextChange Struct
Represents a text replacement applied to a SourceText or to a syntax tree.
public readonly struct TextChange : IEquatable<TextChange>Example
var tree = XmlSyntaxTree.ParseText("<version>1.0.0</version>");
// Replace the 5 characters starting at offset 9 ("1.0.0")
var change = new TextChange(new TextSpan(9, 5), "2.0.0");
var updated = tree.WithChanges(change);
Assert.Equal("<version>2.0.0</version>", updated.GetText().Text);- Implements
Constructors
| Name | Description |
|---|---|
| TextChange(TextSpan, string) |
TextChange(TextSpan, string)
TextChange.csProperties
| Name | Description |
|---|---|
| NewText | |
| Span |
NewText
TextChange.csSpan
TextChange.csMethods
| Name | Description |
|---|---|
| Equals(TextChange) | |
| Equals(object?) | |
| GetHashCode() | |
| ToString() |
Equals overloads
Equals(TextChange)
TextChange.cspublic bool Equals(TextChange other)No documentation is available.
Equals(object?)
TextChange.csGetHashCode()
TextChange.csToString()
TextChange.csOperators
| Name | Description |
|---|---|
| operator ==(TextChange, TextChange) | |
| operator !=(TextChange, TextChange) |
operator ==(TextChange, TextChange)
TextChange.cspublic static bool operator ==(TextChange left, TextChange right)No documentation is available.
operator !=(TextChange, TextChange)
TextChange.cspublic static bool operator !=(TextChange left, TextChange right)No documentation is available.