---
title: BEDirectionalTextRange
framework: browserenginekit
role: symbol
role_heading: Structure
path: browserenginekit/bedirectionaltextrange
---

# BEDirectionalTextRange

Modifications to text length based on its offset.

## Declaration

```swift
struct BEDirectionalTextRange
```

## Overview

Overview This class encapsulates instructions that modify a text selection. In a given instance, the sign of length determines the selection direction from its offset. Positive length indicates moving the selection forward in the string, whereas a negative  length moves the selection backward in the string. For example, applying a directional text range of { -6, -2 } to the selection “world” in the string “Hello world” results in the selection, “Hel”.

## Topics

### Creating a directional text range

- [init()](browserenginekit/bedirectionaltextrange/init().md)
- [init(offset:length:)](browserenginekit/bedirectionaltextrange/init(offset:length:).md)

### Measuring text range

- [length](browserenginekit/bedirectionaltextrange/length.md)
- [offset](browserenginekit/bedirectionaltextrange/offset.md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Sendable](swift/sendable.md)

## See Also

### Information about text

- [BEExtendedTextInputTraits](browserenginekit/beextendedtextinputtraits.md)
