<!--
{
  "availability" : [
    "iOS: 17.4.0 -",
    "iPadOS: 17.4.0 -",
    "tvOS: 17.4.0 -",
    "visionOS: 1.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "BrowserEngineKit",
  "identifier" : "/documentation/BrowserEngineKit/BETextInput/delete(in:to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "BrowserEngineKit"
    ],
    "preciseIdentifier" : "c:objc(pl)BETextInput(im)deleteInDirection:toGranularity:"
  },
  "title" : "delete(in:to:)"
}
-->

# delete(in:to:)

Deletes the specified amount of text.

```
func delete(in direction: UITextStorageDirection, to granularity: UITextGranularity)
```

## Parameters

`direction`

The direction in which to delete text, relative to the base writing direction.

`granularity`

The amount of text to delete.

## Discussion

The editing behavior-to-key combinations include:

- Character backward: Delete
- Character forward: Delete forward (Function + Delete)
- Word backward: Option + Delete
- Word forward: Option + Delete forward (Function + Delete)
- Line end: Command + Delete
- Line start: Command + Delete forward (Function + Delete)
- Paragraph end: Control + K
- Paragraph start: Control + Function + K

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)