28
1
using System;
2
using System.Linq;
3
using System.Collections.Generic;
4
5
6
public class Program
7
{
8
public static void Main()
9
{
10
// string collection
11
IList<string> stringList = new List<string>() {
12
"C# Tutorials",
13
"VB.NET Tutorials",
14
"Learn C++",
15
"MVC Tutorials" ,
16
"Java"
17
};
18
19
// LINQ Method Syntax
20
var result = stringList.Where(s => s.Contains("Tutorials"));
21
22
23
foreach (var str in result)
24
{
25
Console.WriteLine(str);
26
}
27
}
28
}
Cached Result