【问题标题】:Is there any way for getting the direction of writing in specific culture? [duplicate]有什么方法可以在特定文化中获得写作方向吗? [复制]
【发布时间】:2010-04-11 04:12:16
【问题描述】:

可能重复:
Is there any way to determine text direction from CultureInfo in asp.net?

我想获得用户在我的应用程序中选择的任何文化的写作方向。例如,当我的用户使用fa-IR 文化时,我想获得rtl,并在选择en-US 时获得ltr

.NET 中是否有内置解决方案?

【问题讨论】:

标签: c# .net localization culture


【解决方案1】:

使用 TextInfo.IsRightToLeft 属性来确定:

bool isRightToLeft = new CultureInfo("fa-IR").TextInfo.IsRightToLeft;

详情请见MSDN

【讨论】:

    猜你喜欢
    • 2023-03-18
    • 1970-01-01
    • 2019-07-19
    • 2018-05-25
    • 2020-05-11
    • 2023-03-21
    • 1970-01-01
    • 2020-04-02
    • 2021-09-16
    相关资源
    最近更新 更多