c# - Linq query, select everything from one lists property that starts with a string in another list -


Hello I am new to linq and lambda

I have two lists < Pre> fl.LocalOpenFiles ... list & lt; String & gt; F. ....

For example, there is a property to move an index

  fl.LocalOpenFiles [0]. Path   

I wanted to select everything from the first list fl.LocalOpenFiles where fl.LocalOpenFiles.Path to list & lt; String & gt;

I finally got this ...

  list & lt; Local OpenFile & gt; Lof = new list & lt; Local OpenFile & gt; (); Lof = fl.LocalOpenFiles.Join (folders, first => first.path, seconds = & gt; second, (first, second) = & gt; first) .list ();   

But selecting the folders to select it is only first.Path == second and I can not find a way to get the data that I want This "brand" requirement is anything that is present: f [& lt; Any & gt;] == fl.LocalOpenFiles [and lieutenant; Any & gt;] path.Substring (0, f [& lt; any & gt;] length)

Another example ...

  List & lt; String & gt; F = new list & lt; String & gt; {"Abc", "def"}; & Lt; LocalOpenFile & gt; New Local Openfile ("ABC"), New LocalOfFILE ("ABCC"), New LocalOfFile ("Ebbed"), New LocalOfFile ("DiffxSoldF"),)} // Results // ABC should be. // abcc // defxsldf   

I hope I have explained it :) Thanks for your help

Do you mean something about this:

  list & lt; Local OpenFile & gt; Results = lof.Where (file = & gt; f.Any (prefix = & gt; with file.Path.Starts). List ();    < / Html>

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -