52

I have looked around, but I have been unable to figure this out, some languages are read and written from right to left, instead of left to right. It seems like a no-brainer to be able to get the text direction from the CultureInfo object somehow, but I have not seen it anywhere. Am I missing something?

1 Answer 1

87
System.Globalization.CultureInfo.CurrentCulture.TextInfo.IsRightToLeft

This will return true if the current culture is read from right to left.

4
  • 1
    Thanks John. I was inspecting the CultureInfo object, but I overlooked this. Jul 14, 2009 at 20:34
  • 2
    I googled it and found this post. Took me about 10 seconds. So if this question helps 3.5 more people, posting it was most definitely worth it! Jul 9, 2013 at 10:29
  • CultureInfo.TextInfo get me an Error An object reference is required for the non-static field, method, or property 'System.Globalization.CultureInfo.TextInfo.get'
    – oCcSking
    May 12, 2014 at 8:05
  • Use CurrentCulture to make it work: System.Globalization.CultureInfo.CurrentCulture.TextInfo.IsRightToLeft Jun 27, 2014 at 7:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.