Hi all,
I recently shifted from JAVA development environment to .net development environment. I am developing web application using .net MVC framework. Would someone help me to find the meaning of following code segment. It seams like iterating thought list, but I could not find specific definition of this code sample:
SmartTextBoxModel smartTextBoxModel = new SmartTextBoxModel();
List<string> nameList = new List<string>() { "AA", "AB", "AC", "BB", "B" };
var filteredStringList =
from n in nameList
where n.IndexOf(name, 0, StringComparison.OrdinalIgnoreCase) != -1
select n;
The SmartTextBoxModel
class has following code (it basically contains list object and getters and setters).
public class SmartTextBoxModel
{
public SmartTextBoxModel()
{
this.NameList = new List<SelectListItem>();
}
public List<SelectListItem> NameList { get;private set; }
public string Name { get; set; }
}
My Question is what does this line mean:
var filteredStringList =
from n in nameList
where n.IndexOf(name, 0, StringComparison.OrdinalIgnoreCase) != -1
select n;