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
// Say we have a List of names and we would like to find all those names where "am" occurs: | |
{ | |
// LINQ | |
// string[] names = { "Sam", "Pamela", "Dave", "Pascal", "Erik" }; | |
// List<string> filteredNames = names.Where(c => c.Contains("am")) | |
// .ToList(); | |
// Java Streams | |
// String[] names = {"Sam","Pamela", "Dave", "Pascal", "Erik"}; | |
// List<String> filteredNames = stream(names) |