TextClass
Definition
- Namespace
- DOM.Elements.TextElements
- Assembly
- DOM.dll
Represents a text run within the document model.
Remarks
A node holds the smallest unit of document content: a literal string of characters plus an optional character-level style. It corresponds to a <w:r> element in WordprocessingML and to a <span> in HTML. Text Text runs are typically created by calling on a or by instantiating a directly. They support search and replace operations with optional regular-expression, whole-word, and case-sensitivity behaviour via and . AddText(string) Paragraph Text Find(string, RegexOptions?, bool, bool) Replace(string, string, RegexOptions?, bool, bool)
Examples
Constructors
Initializes a new instance of the class with empty content. Text
Initializes a new instance of the class with the specified content. Text
Properties
Gets or sets the literal textual content contained in this text run.
Gets or sets the style applied to this text run.
The style is applied per-run, so a paragraph may mix several styles by combining multiple instances with different values. Text Style
Methods
Finds all occurrences of the specified search text within the current text content. Supports optional regular expression behavior, whole-word matching, and case-sensitivity controls. Returns a list of character indices where matches occur.
Replaces occurrences of the specified search text within the current text content. Supports optional regular expression behavior, whole-word matching, and case-sensitivity controls.