在哪里可以找到不同C#类的字符串文字格式? [英] Where can I find string literal formats for different C# classes?

查看:58
本文介绍了在哪里可以找到不同C#类的字符串文字格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

System.Globalization.CultureInfo("en-US")

示例2

DictationGrammar spellingDictationGrammar =    new DictationGrammar("grammar:dictation#spelling");

在给定的示例中,我正在寻找一个列出所有字符串文字的列表,例如 "zh-CN" 和" grammar:dictation#spelling" (针对特定班级).我在MS文档中搜索了C#,但只能在示例中找到其中的一些内容.
我在哪里可以从字面上找到这些文字?

-谢谢

In the given examples I'm looking for a list that list all the string literal like "en-US" and "grammar:dictation#spelling" for the specific classes. I searched the MS documentation for C# but I can only find some of then only in examples.
Where can I find such literals literally ?

-Thanks

推荐答案

对于第一部分,该列表可以在 CultureInfo 文档中找到( https://msdn.microsoft.com/en-us/library/cc233982.aspx ),但可以也可以通过编程获得:

For the first part, the list can found in documentation for CultureInfo (https://msdn.microsoft.com/en-us/library/cc233982.aspx), but can be also obtained programmatically:

foreach( var c in CultureInfo.GetCultures( CultureTypes.AllCultures ).OrderBy( c => c.Name ) )
{
   Console.WriteLine( "{0,-12} {1}", c.Name, c.EnglishName );
}






这篇关于在哪里可以找到不同C#类的字符串文字格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆