本文整理汇总了C#中ArrayList.where方法的典型用法代码示例。如果您正苦于以下问题:C# ArrayList.where方法的具体用法?C# ArrayList.where怎么用?C# ArrayList.where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayList
的用法示例。
在下文中一共展示了ArrayList.where方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: test
public static string test() {
var objects = new ArrayList<WhereSequenceEqual> {
new WhereSequenceEqual("obj1", new ArrayList<string> { "a", "b" }),
new WhereSequenceEqual("obj2", new ArrayList<string> { "c", "d" }),
new WhereSequenceEqual("obj3", new ArrayList<string> { "e", "f" })
};
return objects.where(p => p.items.sequenceEqual(new ArrayList<string> { "c", "d" })).single().name;
}
示例2: test
public static bool test() {
var l = new ArrayList<string> { "aa", "bb", "cc" };
var l2 = new ArrayList<string> { "a", "b", "c" };
return l.where(str => l2.where(p => str.startsWith(p)).any()).count() == 3;
}
示例3: method
public int method(string s) {
var l = new ArrayList<string> { "aaa", "bbbb", "ccc" };
int n = s.length();
return l.where(p => p.length() == n && p[0] == s[0]).count();
}
示例4: test
public static int test() {
var list = new ArrayList<string> { "a", "bb", "ccc" };
return list.where(p => p.length() > 1).count();
}