If I have the culture code for a country/language combination, is it possible to from this, find the text direction.
For example for en-US how can I get from this that the text direction is left to right? And in turn from ar-EG, how do I know the text direction is right to left?
This can easily be done using the TextInfo.IsRightToLeft
property of CultureInfo
Example:
CultureInfo.GetCultureInfo("ar-EG").TextInfo.IsRightToLeft; // Return True
CultureInfo.GetCultureInfo("en-us").TextInfo.IsRightToLeft; // Return False
CultureInfo.GetCultureInfo("he-il").TextInfo.IsRightToLeft; // Return True
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With