Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
pass-len-to-predicate-modified
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int len = 5; bool val2 = Result(new string[5] { "asdf", "a", "asdsffsfs", "wewretete", "adcv" }, x => StringLengthGreaterThanGivenNumber(x, 5,1,2)); Console.WriteLine(val2); } static bool Result<T>(T[] values, Func<T, bool> predicate) { if (values.Where<T>(predicate).Count() > 0) return true; else return false; } static bool StringLengthGreaterThanGivenNumber(string str, int length, int length2, int length3) { return str.Length > length + length2 + length3 ; } } }
run
|
edit
|
history
|
help
0
WDW
nguoi
generics one more doubt-stack overflow exception
Encrption & Decryption C#
Events
Quickly reach memory limit
sdfghjkilujyht
12
IntNull
first test