C# continue in one line ForEach -
why can't ? how manipulate code ?
system.io.directory.getfiles(@"..\data\data", "*.pdf").tolist().foreach(item => item.contains("toprint") ? continue : system.io.file.delete(item)); 
i add where before foreach
system.io.directory.getfiles(@"..\data\data", "*.pdf")       .where(item => !item.contains("toprint")).tolist()       .foreach(f=> system.io.file.delete(f)); 
Comments
Post a Comment