i am having some file names in array list Like, "Form.frm,Form1.frm,Form2.frm,Module.bas,Module23.bas" in the array list i want to make the first item as ".bas" files how can i make it using array list.
2 Answers
I understand that you want to order the items by the extension, this can be done in this way:
List<string> fileNames = new List<string>();
fileNames.Add("Form.frm");
fileNames.Add("Form1.frm");
fileNames.Add("Form2.frm");
fileNames.Add("Module.bas");
fileNames.Add("Module23.bas");
var ordered = fileNames.OrderBy(p => Path.GetExtension(p));
1 Comment
Gustavo F
Damn 5 minutes of slow connection :(
ArrayListinstead of aList<string>--ArrayListis obsolete.