This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Main(string[] args) | |
{ | |
List<int> foo = new List<int> { 6, 1, 4, 9, 2 }; //list | |
Console.WriteLine(foo.Count()); // show size | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT name FROM meal WHERE price < 1000 |