<div class="meta" robots="noindex">

</div>

Method

# Graphics.StringDirection

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `Graphics.TextDirection<graphics.textdirection>` as a replacement.

</div>

## Description

Returns an `Integer</api/data_types/integer>` that indicates the direction in which the text is written.

## Notes

This is useful for non-Roman systems, especially Middle-Eastern languages. If you pass an empty string, it returns the system default string direction. If this function is not supported on the user's system, it will return -1; otherwise it will return either 0 for left to right or 1 or right to left.

There are three class constants that you can use to test the string direction:

| Class Constant           | Value |
|--------------------------|-------|
| TextDirectionUnknown     | -1    |
| TextDirectionLeftToRight | 0     |
| TextDirectionRightToLeft | 1     |

## Sample code

This example gets the string direction.

``` xojo
Dim i As Integer
i = g.StringDirection("Hello world")
```

## Compatibility

All project types on all supported operating systems.
