當前位置: 首頁>>代碼示例>>C#>>正文


C# CultureInfo.Substring方法代碼示例

本文整理匯總了C#中System.Globalization.CultureInfo.Substring方法的典型用法代碼示例。如果您正苦於以下問題:C# CultureInfo.Substring方法的具體用法?C# CultureInfo.Substring怎麽用?C# CultureInfo.Substring使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Globalization.CultureInfo的用法示例。


在下文中一共展示了CultureInfo.Substring方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TranslateName

        private string TranslateName(string code)
        {
            string nativeName = new CultureInfo(code).NativeName;
            string languageName = new CultureInfo(code).EnglishName;

            if (code != ApplicationData.Current.RoamingSettings.Values["primary"].ToString())
            { return nativeName.First().ToString().ToUpper() + nativeName.Substring(1) + " / " + languageName; }
            else
            { return nativeName; }
        }
開發者ID:diagonalwalnut,項目名稱:GodTools,代碼行數:10,代碼來源:Settings.xaml.cs

示例2: putariaAdapter

 public putariaAdapter(string nomeLoja, int mes, float total, float SomaValorAluguel)
 {
     this.NomeDaLoja = nomeLoja;
     this.SomaTotal = total;
     this.valoraluguel = SomaValorAluguel;
     this.MesReferencia = new DateTime(1900, mes, 1).ToString("MMMM", new CultureInfo("pt-BR"));
     //Mês abreviado em português também.
     this.MesReferencia = new CultureInfo("pt-BR").DateTimeFormat.GetAbbreviatedMonthName(mes);
     //Mês (int) por extenso com primeira letra maiúscula.
     string month = new CultureInfo("pt-BR").DateTimeFormat.GetMonthName(mes);
     this.MesReferencia = char.ToUpper(month[0]) + month.Substring(1);
 }
開發者ID:josafamelo,項目名稱:ControlShop,代碼行數:12,代碼來源:RelatorioController.cs

示例3: TranslateLanguage

        private string TranslateLanguage(Language language)
        {
            try
                {
                    if (language.code != CultureInfo.CurrentUICulture.TwoLetterISOLanguageName)
                    {
                        string uiLanguage = new CultureInfo(language.code).NativeName;

                        language.name = uiLanguage.First().ToString().ToUpper() + uiLanguage.Substring(1) + " / " + language.name;
                    }
                }
                catch (Exception exception)
                {
                    System.Diagnostics.Debug.WriteLine("Language Code does not exist.");

                    language.name = language.name + " (not found)";
                }

            return language.name;
        }
開發者ID:diagonalwalnut,項目名稱:GodTools,代碼行數:20,代碼來源:Languages.cs

示例4: TranslateLanguageList

        private IList<Language> TranslateLanguageList(string language, IList<Language> languageList)
        {
            foreach (Language item in languageList)
            {
                try
                {
                    if (item.code != CultureInfo.CurrentUICulture.TwoLetterISOLanguageName)
                    {
                        string uiLanguage = new CultureInfo(item.code).NativeName;

                        item.name = uiLanguage.First().ToString().ToUpper() + uiLanguage.Substring(1) + " / " + item.name;
                    }
                }
                catch (Exception exception)
                {
                    System.Diagnostics.Debug.WriteLine("Language Code does not exist.");

                    item.name = item.name + " (not found)";
                }
            }

            return languageList;
        }
開發者ID:diagonalwalnut,項目名稱:GodTools,代碼行數:23,代碼來源:Languages.cs


注:本文中的System.Globalization.CultureInfo.Substring方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。