使用LINQ我打算分解下面的路徑string[]
,但是我想將它分解爲Binn文件夾。 LINQ中是否存在WHERE UNTIL運算符?LINQ表達式直到打破一個字符串
c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Binn\sqlservr.exe
我想什麼待辦事項
var words = from word in thepath
where UNTIL thepath == "Binn"
select word;
必須使用LINQ這個?你不能使用'Path'類:http://dotnetperls.com/getdirectoryname然後你可以「分割」返回的目錄名來獲取路徑的每一部分。 – 2010-06-16 09:39:54
因爲我想要完整的目錄到某個點。 LINQ似乎是一個更好的方法。 – wonea 2010-06-16 09:57:18