isRTL
function isRTL(text): boolean;Defined in: text.ts:410
Whether text reads right to left: its first letter is from a right-to-left script such as Urdu or Arabic. Digits, punctuation and spaces are skipped, as in the Unicode bidirectional algorithm’s paragraph rule.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text |
string |
Returns
Section titled “Returns”boolean
false when there is no letter, or the input is not a string.
Never throws.
Example
Section titled “Example”isRTL('سلام'); // trueisRTL('123 سلام'); // trueisRTL('Order نمبر'); // false