嗨世界人民。從包含兩個字符串的字符串數組中獲取所有可能的值c#
我是一個初學者C#程序員,我有NA陣列與許多從該目錄文件路徑的:
'C:\ProgramData\folder1\fodler2\folder3\'
數組是這樣的:
string[] arrays = {'C:\ProgramData\folder1\fodler2\folder3\sw2-client1-propose1-measure1.dbf', 'C:\ProgramData\folder1\fodler2\folder3\sw-client1-propose2-measure1.dbf', 'C:\ProgramData\folder1\fodler2\folder3\sw1-client1-propose2-measure2.dbf', 'C:\ProgramData\folder1\fodler2\folder3\sw1-client1-propose2-measure1.dbf' }
有了這個爲例,你可以請參閱陣列中的文件具有以下結構:
sw-client-propose-measure.dbf
其中:
sw - a string meaning the name of the software used to get the values to the database
client - the ID of clients
propose - the ID of proposes
measure - the ID of measure
現在我需要獲得一個數組,其中包含字符串數組中具有特定求和ID和sw名稱的所有路徑。
你能幫我實現我的結果嗎?
在此先感謝。
你有什麼代碼,使遠嗎? – ergonaut
我會看看幾個選項。如果你想把所有東西放在一個數組中,我會考慮使用正則表達式對數組值。另一個選項將表示數組之外的數據。 – AnotherDeveloper
我找不出最好的代碼來得到我需要的東西:(我在網上搜索所有的東西我找不到任何與此相關的東西... – user3664117