Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 439
  • Last Modified:

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

Can someone explain me what the S stand for in
    movies = movies.Where(s => s.Title.Contains(searchString));

Thank you,
0
yguyon28
Asked:
yguyon28
1 Solution
 
käµfm³d 👽Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now