skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Interface ICharacterData

The

CharacterData
interface extends Node with a set of attributes and methods for accessing character data in the DOM. For clarity this set is defined here rather than on each object that uses these attributes and methods. No DOM objects correspond directly to

CharacterData
, though
Text
and others do

inherit the interface from it. All

offsets
in this interface start from
0
.

As explained in the

DOMString
interface, text strings in the DOM are represented in UTF-16, i.e. as a sequence of 16-bit units. In the following, the term 16-bit units is used whenever necessary to indicate that indexing on CharacterData is done in 16-bit units.

See also the Document Object Model (DOM) Level 2 Core Specification.

Inherited Members
INode.InsertBefore(INode, INode)
INode.ReplaceChild(INode, INode)
INode.RemoveChild(INode)
INode.AppendChild(INode)
INode.HasChildNodes()
INode.CloneNode(Boolean)
INode.Normalize()
INode.IsSupported(String, String)
INode.HasAttributes()
INode.NodeName
INode.NodeValue
INode.NodeType
INode.ParentNode
INode.ChildNodes
INode.FirstChild
INode.LastChild
INode.PreviousSibling
INode.NextSibling
INode.Attributes
INode.OwnerDocument
INode.NamespaceURI
INode.Prefix
INode.LocalName
Namespace: Telerik.WinForms.Documents.FormatProviders.Html.Parsing.Dom
Assembly: Telerik.WinControls.RichTextEditor.dll

Syntax

public interface ICharacterData : INode

Properties

Data

The character data of the node that implements this interface. The DOM implementation may not put arbitrary limits on the amount of data that may be stored in a

CharacterData
node. However, implementation limits may mean that the entirety of a node's data may not fit into a single
DOMString
. In such cases, the user may call
substringData
to retrieve the data in appropriately sized pieces.

Declaration
string Data { get; set; }
Property Value
System.String

Exceptions
DomException

NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.

DomException

DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a

DOMString
variable on the implementation platform.

Length

The number of 16-bit units that are available through

data
and the
substringData
method below. This may have the value zero, i.e.,
CharacterData
nodes may be empty.

Declaration
int Length { get; }
Property Value
System.Int32

Methods

AppendData(String)

Append the string to the end of the character data of the node. Upon success,

data
provides access to the concatenation of

data
and the
DOMString
specified.
Declaration
void AppendData(string arg)
Parameters
System.String arg

The

DOMString
to append.

Exceptions
DomException

NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

DeleteData(Int32, Int32)

Remove a range of 16-bit units from the node. Upon success,

data
and
length
reflect the change.
Declaration
void DeleteData(int offset, int count)
Parameters
System.Int32 offset

The offset from which to start removing.

System.Int32 count

The number of 16-bit units to delete. If the sum of

offset
and
count
exceeds
length
then all 16-bit units from
offset

to the end of the data are deleted.

Exceptions
DomException

INDEX_SIZE_ERR: Raised if the specified

offset
is negative or greater than the number of 16-bit units in

data
, or if the specified
count
is

negative.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

InsertData(Int32, String)

Insert a string at the specified 16-bit unit offset.

Declaration
void InsertData(int offset, string arg)
Parameters
System.Int32 offset

The character offset at which to insert.

System.String arg

The

DOMString
to insert.

Exceptions
DomException

INDEX_SIZE_ERR: Raised if the specified

offset
is negative or greater than the number of 16-bit units in

data
.


NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

ReplaceData(Int32, Int32, String)

Replace the characters starting at the specified 16-bit unit offset with the specified string.

Declaration
void ReplaceData(int offset, int count, string arg)
Parameters
System.Int32 offset

The offset from which to start replacing.

System.Int32 count

The number of 16-bit units to replace. If the sum of

offset
and
count
exceeds
length
, then all 16-bit units to the end of the data

are replaced; (i.e., the effect is the same as a

remove
method call with the same range, followed by an
append
method invocation).

System.String arg

The

DOMString
with which the range must be replaced.

Exceptions
DomException

INDEX_SIZE_ERR: Raised if the specified

offset
is negative or greater than the number of 16-bit units in

data
, or if the specified
count
is

negative.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

SubstringData(Int32, Int32)

Extracts a range of data from the node.

Declaration
string SubstringData(int offset, int count)
Parameters
System.Int32 offset

Start offset of substring to extract.

System.Int32 count

The number of 16-bit units to extract.

Returns
System.String

The specified substring. If the sum of

offset
and

count
exceeds the
length
, then all 16-bit

units to the end of the data are returned.

Exceptions
DomException

INDEX_SIZE_ERR: Raised if the specified

offset
is negative or greater than the number of 16-bit units in

data
, or if the specified
count
is

negative.
DOMSTRING_SIZE_ERR: Raised if the specified range of text does not fit into a

DOMString
.

Extension Methods

SvgExtentions.Traverse<T>(T, Func<T, IEnumerable<T>>)
SvgExtentions.TraverseDepthFirst<T>(T, Func<T, IEnumerable<T>>)
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.