Solved

movies = movies.Where(s => s.Title.Contains(searchString));

Posted on 2014-03-11
1
304 Views
Last Modified: 2014-03-18
Can someone explain me what the S stand for in
    movies = movies.Where(s => s.Title.Contains(searchString));

Thank you,
0
Comment
Question by:yguyon28
1 Comment
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39921737
It's a variable that holds the current movie in the collection while the Where is iterating. You can roughly translate the Where into this:

List<Movie> filteredMovies = new List<Movie>();

foreach (Movie s in movies)
{
    if (s.Title.Contains(searchString))
    {
        filteredMovies.Add(s);
    }
}

movies = filteredMovies;

Open in new window

0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question