-2
我有一個C#中的字符串列表。它包含以下子字符串,位於列表中字符串的中間。該列表沒有排序。我想根據以下條目訂購此列表:如何根據字符串值的參考列表排序字符串列表
Email FirstName LastName Country Province Phone Fax
按此順序。
例如,如果原始列表有以下條目:
The field Province required 5 letters Wrong Email Phone is required FirstName should contain min of 5 letters The field Fax requires 10 digits Enter a valid LastName Fax is required The field Phone requires 10 digits
它需要如下進行排序:
Wrong Email FirstName should contain min of 5 letters Enter a valid LastName The field Province required 5 letters Phone is required The field Phone requires 10 digits Fax is required The field Fax requires 10 digits
感謝
如果這是關於正確命令基於一系列表單字段的驗證輸出,我有下沉的感覺,你會走錯方向。 – flq
我不認爲你想要/需要這個正則表達式 - 我可能會使用[字符串]列表,然後以編程方式重新排序。另外,作爲一個附註(我沒有投票給你) - 我的名字包含4個字母,這會讓我感到沮喪。 – Nefariis