- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在寻找一种获取包含所有英文(拉丁文)字符的列表的有效方法。
A, B, C, .... , Z
我真的不想要这样的构造函数:
// nasty way to create list of English alphabet
List<string> list = new List<string>();
list.Add("A");
list.Add("B");
....
list.Add("Z");
// use the list
...
如果您对它的用途感到好奇,我正在创建一个 bin-tree 机制。
最佳答案
您可以使用 for
来做到这一点循环:
List<char> list = new List<char>();
for (char c = 'A'; c <= 'Z'; ++c) {
list.Add(c);
}
如果你想要一个List<string>
而不是 List<char>
使用 list.Add(c.ToString());
相反。
请注意,这仅适用于字母 A - Z 在 Unicode 中以连续序列出现(代码点 65 到 90)。同样的方法不一定适用于其他字母表。
关于c# - 如何列出所有拉丁(英文字母)字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8459620/
我对UDF pig 拉丁有问题。 我正在尝试实现一个系统,该系统必须验证本地存储的矩阵与hadoop存储库中存储的一组矩阵之间是否存在“映射”。 对于映射,我的意思是在hadoop中是否存在一个存储矩
数据库的排序规则用法是什么?好吧,对于 HTML UTF-8,我知道一点,比如显示其他语言类型。但是对于数据库呢?我正在使用 latin-1(默认),我的 friend 告诉我改用 UTF。当我问为什
我有以下带有架构的数据 (t0: chararray,t1: int,t2: int) (B,4,2) (A,2,3) (A,3,2) (B,2,2) (A,1,2) (B,1,2) 我想生成以下结果
我正在尝试构建 AOSP 拉丁 IME(源代码:https://android.googlesource.com/platform/packages/inputmethods/LatinIME/+/m
我正在实现过滤器功能。我使用以下方法定义字符串是否适合查询: someString.IndexOf(someSearch, StringComparison.OrdinalIgnoreCase) >=
我是一名优秀的程序员,十分优秀!