Skip to content

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.

Parameter Type
text string

boolean

false when there is no letter, or the input is not a string. Never throws.

isRTL('سلام'); // true
isRTL('123 سلام'); // true
isRTL('Order نمبر'); // false