# TextDirectionHeuristic

Added in[API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

# TextDirectionHeuristic

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/text/TextDirectionHeuristic "View this page in Kotlin")\|Java

`
public


interface
TextDirectionHeuristic
`  
`


`

|-------------------------------------|
| android.text.TextDirectionHeuristic |

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                                                       ### Public methods                                                                                                                                                       ||
|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract boolean` | ` `[isRtl](https://developer.android.com/reference/android/text/TextDirectionHeuristic#isRtl(char[],%20int,%20int))`(char[] array, int start, int count) ` Guess if a chars array is in the RTL direction or not.                                                                                         |
| ` abstract boolean` | ` `[isRtl](https://developer.android.com/reference/android/text/TextDirectionHeuristic#isRtl(java.lang.CharSequence,%20int,%20int))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` cs, int start, int count) ` Guess if a`CharSequence`is in the RTL direction or not. |

## Public methods

### isRtl

Added in[API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract boolean isRtl (char[] array, 
                int start, 
                int count)
```

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

<br />

|                                                  Parameters                                                  ||
|---------|-----------------------------------------------------------------------------------------------------|
| `array` | `char`: the char array. <br />                                                                      |
| `start` | `int`: start index, inclusive. <br />                                                               |
| `count` | `int`: the length to check, must not be negative and not greater than`array.length - start`. <br /> |

|                                                  Returns                                                   ||
|-----------|-------------------------------------------------------------------------------------------------|
| `boolean` | true if all chars in the range are to be considered in a RTL direction, false otherwise. <br /> |

### isRtl

Added in[API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract boolean isRtl (CharSequence cs, 
                int start, 
                int count)
```

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

<br />

|                                                      Parameters                                                       ||
|---------|--------------------------------------------------------------------------------------------------------------|
| `cs`    | `CharSequence`: the CharSequence. <br />                                                                     |
| `start` | `int`: start index, inclusive. <br />                                                                        |
| `count` | `int`: the length to check, must not be negative and not greater than`CharSequence.length() - start`. <br /> |

|                                                  Returns                                                   ||
|-----------|-------------------------------------------------------------------------------------------------|
| `boolean` | true if all chars in the range are to be considered in a RTL direction, false otherwise. <br /> |