# Javascript: TextCharCollection.remove Method

> Removes the character by number.

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

---

### Description

Removes the character by number.

### Syntax

```javascript
<void> TextCharCollection.remove(<number> number, [<RequestBooleanCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| number | Specifies which character to remove by the textchar's number. The first character has the number 1. |
| callback | Optional. Receives whether the textchar is succesfully removed. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `TextCharCollection.remove` in a practical document-editing workflow. It removes the character by number.

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

function remove(textChars) {
    textChars.remove(
        1,
        function(result) {
            if (result) {
                console.log("remove is available.");
            } else {
                console.warn("remove is not available in the current document state.");
            }
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: TextCharCollection.getItem Method](https://docs.textcontrol.com/ds-server/reference/javascript/textcharcollection/getitem-method/llms-full.txt)
- **Next:** [TextControlChangedCallback Function](https://docs.textcontrol.com/ds-server/reference/javascript/textcontrolchangedcallback/llms-full.txt)
