Skip to content

Instantly share code, notes, and snippets.

View Collonville's full-sized avatar
🍻
Happy beer!!!! Wow!!!!!!

Collonville Collonville

🍻
Happy beer!!!! Wow!!!!!!
View GitHub Profile
static void Main(string[] args)
{
List<int> foo = new List<int> { 6, 1, 4, 9, 2 }; //list
var cnt = foo.Select(x => x * 2).Where(x => x <= 14).Count();
Console.WriteLine(cnt); // show count
}
class Program
{
static void Main(string[] args)
{
List<Player> foo = new List<Player>
{
new Player(100, "Miku"),
new Player(350, "Ren"),
new Player(700, "Yukarin"),
new Player(3500, "IA")
static void Main(string[] args)
{
List<int> foo = new List<int> { 6, 1, 4, 9, 2 }; //list
Console.WriteLine(foo.Count()); // show size
}
static void Main(string[] args)
{
List<int> foo = new List<int> { 6, 1, 4, 9, 2 }; //list
var boo = foo.Where(x => x % 2 == 0 && x < 5); //get even num and is under 5
boo.ToList().ForEach(x => Console.WriteLine(x)); //show
}
static void Main(string[] args)
{
List<int> foo = new List<int> { 6, 1, 4, 9, 2 }; //list
var boo = foo.Where(x => x % 2 == 0); //get even num
boo.ToList().ForEach(x => Console.WriteLine(x)); //show
}
static void Main(string[] args)
{
List<int> foo = new List<int> { 6, 1, 4, 9, 2 }; //list
var boo = foo.Select(x => x * x); //power
boo.ToList().ForEach(x => Console.WriteLine(x)); //show
}
static void Main(string[] args)
{
List<int> foo = new List<int> { 6, 1, 4, 9, 2 }; //list
var boo = foo.Where(x => x >= 5); //LINQ
boo.ToList().ForEach(x => Console.WriteLine(x)); //show
}
static void Main(string[] args)
{
List<int> foo = new List<int> { 6, 1, 4, 9, 2 }; //list
var boo = foo.Where(x => x >= 5); //LINQ
foreach (var data in boo)
{
System.Console.WriteLine(data);
}
static void Main(string[] args)
{
List<int> foo = new List<int> { 6, 1, 4, 9, 2 }; //list
List<int> boo = new List<int>(); //new list
foreach (var data in foo)
{
if (data >= 5)
{
boo.Add(data);
SELECT name FROM meal WHERE price < 1000