title: Filter one list using index value obtained from another list using linq
body: <p>I've got one list which contains string</p>
  
  <pre><code>List&lt;string&gt; valueList = new List&lt;string&gt;();
  
  valueList.Add("test1");
  valueList.Add("test2");
  valueList.Add("test3");
  valueList.Add("test4");
  valueList.Add("test5");
  valueList.Add("test6");
  valueList.Add("test7");
  valueList.Add("test8");
  </code></pre>
  
  <p>and I've got another list which contains objects</p>
  
  <pre><code>List&lt;test&gt; fieldList = new List&lt;test&gt;();
  fieldList.Add(new test() { FieldName = "field1", FieldType = 1, FieldIndex = 0 });
  fieldList.Add(new test() { FieldName = "field3", FieldType = 1, FieldIndex = 2 });
  fieldList.Add(new test() { FieldName = "field5", FieldType = 1, FieldIndex = 4 });
  </code></pre>
  
  <p>I want to use the FieldIndex property from the object contained in fieldList, so I build a list which just contains the fieldIndex values using the following</p>
  
  <pre><code>var mylist = fieldList.Select(m =&gt; m.FieldIndex).ToList();
  </code></pre>
  
  <p>But now I'd like to use that list of <code>fieldindex</code> to retrieve the values from <code>valuelist</code>, so based on the above <code>myList</code> will contain test1, test3 and test5 and ideally I'd like to end up with a string a comma between each i.e. <code>string values = "test1,test3,test5"</code></p>
  
  <p>I'm sure there has to be a way of doing this using linq, but can't figure out how!</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks.</p>