I got a list of strings like:
{ID: caa206a29 Product Stock is: MMB-808 -> Expected Stock on MMB: MMB-813,
ID: 46ca37fbb Product Stock is: MMB-8002 -> Expected Stock on MMB: MMB-222,
ID: e8109b18d Product Stock is: MMB-8005 -> Expected Stock on MMB: MMB-223,
ID: 1747fb04a Product Stock is: MMB-8005 -> Expected Stock on MMB: MMB-223,
ID: ecbf00f93 Product Stock is: MMB-8001 -> Expected Stock on MMB: MMB-223,
ID: 1b55eed17 Product Stock is: MMB-868 -> Expected Stock on MMB: MMB-864,
ID: a51fa3073 Product Stock is: MMB-862 -> Expected Stock on MMB: MMB-864,
ID: 08b75eb96 Product Stock is: MMB-863 -> Expected Stock on MMB: MMB-864,
ID: b89c8ac55 Product Stock is: MMB-861 -> Expected Stock on MMB: MMB-864,
ID: 70b709d1a Product Stock is: MMB-863 -> Expected Stock on MMB: MMB-822,
}
i want to sort it OrderBy int after MMB in 5 column to received list like
ID: caa206a29 Product Stock is: MMB-808 -> Expected Stock on MMB: MMB-813,
ID: b89c8ac55 Product Stock is: MMB-861 -> Expected Stock on MMB: MMB-864,
ID: a51fa3073 Product Stock is: MMB-862 -> Expected Stock on MMB: MMB-864,
ID: 08b75eb96 Product Stock is: MMB-863 -> Expected Stock on MMB: MMB-864,
ID: 70b709d1a Product Stock is: MMB-863 -> Expected Stock on MMB: MMB-822,
ID: 1b55eed17 Product Stock is: MMB-868 -> Expected Stock on MMB: MMB-864,
ID: ecbf00f93 Product Stock is: MMB-8001 -> Expected Stock on MMB: MMB-223,
ID: 46ca37fbb Product Stock is: MMB-8002 -> Expected Stock on MMB: MMB-222,
ID: e8109b18d Product Stock is: MMB-8005 -> Expected Stock on MMB: MMB-223,
ID: 1747fb04a Product Stock is: MMB-8005 -> Expected Stock on MMB: MMB-223,
my code
string [] list_of_product = new string [];
var separator = string [" "];
foreach(sting s in list_of_product)
{
var spliting = s.Split(separator, StringSplitOptions.None);
//sorting method
}
I am thinking about sortin by Linq Orderby s => int.Parse or standard sort with IComparer
all suggestions are welcome. thanks everyone in advance !
IEnumerable<MyClass>you can sort, filter etc. as you want