# TextCharCollection Object

> Contains all characters in a Text Control document or part of the document.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Object
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > TextCharCollection Object
- **712 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/textcharcollection/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/textcharcollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/textcharcollection/llms-full.txt

---

### Description

Contains all [characters](https://docs.textcontrol.com/ds-server/reference/javascript/textchar/llms-full.txt) in a Text Control document or part of the document.

### Syntax

```javascript
TextCharCollection
```

### Examples

The following example demonstrates `TextCharCollection` in a practical document-editing workflow. It contains all characters in a Text Control document or part of the document.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function inspectTextCharCollection(textChars) {
    textChars.getItem(
        { x: 1440, y: 720 },
        true,
        function(textChar) {
            if (!textChar) {
                console.warn("No text char was returned.");
                return;
            }
            
            console.log("get item result:", textChar);
        },
        onTxError
    );
}
```

---

## In This Section

- [Javascript: TextCharCollection.add Method](https://docs.textcontrol.com/ds-server/reference/javascript/textcharcollection/add-method/llms-full.txt): Inserts a character at the specified position using the specified font.
- [Javascript: TextCharCollection.addControlChar Method](https://docs.textcontrol.com/ds-server/reference/javascript/textcharcollection/addcontrolchar-method/llms-full.txt): Inserts a control character at the specified text input position.
- [Javascript: TextCharCollection.getItem Method](https://docs.textcontrol.com/ds-server/reference/javascript/textcharcollection/getitem-method/llms-full.txt): Gets a particular character from the collection specified through a certain geometrical position.
- [Javascript: TextCharCollection.remove Method](https://docs.textcontrol.com/ds-server/reference/javascript/textcharcollection/remove-method/llms-full.txt): Removes the character by number.

---

## Nearby

- **Previous:** [Javascript: TextChar.getNumber Method](https://docs.textcontrol.com/ds-server/reference/javascript/textchar/getnumber-method/llms-full.txt)
- **Next:** [Javascript: TextCharCollection.add Method](https://docs.textcontrol.com/ds-server/reference/javascript/textcharcollection/add-method/llms-full.txt)
