# TextDirectionHeuristicCompat

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/text/TextDirectionHeuristicCompat.java+class:androidx.core.text.TextDirectionHeuristicCompat) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***

<br />

```
interface TextDirectionHeuristicCompat
```

<br />

*** ** * ** ***

Interface for objects that use a heuristic for guessing at the paragraph direction by examining text.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/text/TextDirectionHeuristicCompat#isRtl(char[],int,int)(array: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char/index.html>!, start: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, count: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Guess if a chars array is in the RTL direction or not. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/text/TextDirectionHeuristicCompat#isRtl(java.lang.CharSequence,int,int)(cs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html!, start: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, count: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Guess if a `CharSequence` is in the RTL direction or not. |

## Public functions

### isRtl

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun isRtl(array: CharArray<Char>!, start: Int, count: Int): Boolean
```

Guess if a chars array is in the RTL direction or not.

| Parameters |
|---|---|
| `array: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char/index.html>!` | the char array. |
| `start: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | start index, inclusive. |
| `count: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the length to check, must not be negative and not greater than `array.length - start`. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if all chars in the range are to be considered in a RTL direction, false otherwise. |

### isRtl

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun isRtl(cs: CharSequence!, start: Int, count: Int): Boolean
```

Guess if a `CharSequence` is in the RTL direction or not.

| Parameters |
|---|---|
| `cs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html!` | the CharSequence. |
| `start: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | start index, inclusive. |
| `count: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the length to check, must not be negative and not greater than `CharSequence.length() - start`. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if all chars in the range are to be considered in a RTL direction, false otherwise. |