score:2
Accepted answer
You don't need a comparer
to achieve this. Just try something like this:
var res = lettersAndNumbers.OrderBy(c => !int.TryParse(c, out var temp) ? c :
temp.ToString("D10"))
.OrderBy(c=> !char.IsDigit(c[0]) ? 0 : 1).ToList();
Source: stackoverflow.com
Related Articles
- OrderBy custom comparer specific letters before numbers
- Linq orderby two-column sort with custom comparer
- Using Lambda OrderBy Comparer to give weight to a specific string value
- orderby () containing numbers and letters
- List or Array of String Contain specific word in Html Source Code
- Linq OrderBy against specific values
- Custom sort logic in OrderBy using LINQ
- Populate a list with a specific range of numbers by using LINQ
- Custom OrderBy on a List<T>
- Linq syntax for OrderBy with custom Comparer<T>
- Entity Framework 6 Code First Custom Functions
- OrderBy clause before Where clause - performance?
- How do I use a custom comparer with the Linq Distinct method?
- writing a custom comparer for linq groupby
- LinQ distinct with custom comparer leaves duplicates
- LINQ OrderBy anonymous object with projection comparer
- OrderBy numbers that are strings (cannot convert to int)
- Count how many items appear before an item with a specific ID
- LINQ OrderBy custom order
- LINQ Source Code Available
- multiple orderby in this linq code
- .NET 4 Code Contracts: "requires unproven: source != null"
- orderby certain property - code improvement
- Orderby doesn't call Compare() of the provided comparer
- Enumerable.Except does not use my custom comparer
- LINQ Lambda efficiency of code groupby orderby
- OrderBy numbers and ThenBy boolean not working for List
- Linq custom OrderBy using constants
- EF Code first Eager loading and OrderBy problem
- List.Orderby in C# first orderby numbers that are even asc then same number that are odd decending
- LINQ Split list into lists by date
- LINQ Using ROW_NUMBER() function?
- How extract properties from several objects with LINQ
- Dynamic Linq Group By UnixTime
- Await results from DataContext.ExecuteQuery
- How to debug LINQ result
- Join/merge two excel files in asp.net and display them in gridview
- If result of the LINQ has an interface type it means it has a deferred execution
- IQueryable does not contain a definition for SingleOrDefault
- Get "Value" property in IGrouping
- Summing linq data by year
- How to invoke Expression<Func<Entity, bool>> against a collection
- Entity SQLCE Can't find connection string in app.config file
- How do I group by using anonymous type
- Linq to Entities - OrderBy Tags (many to many relationship)
- From SQL server, extract a list of Users containing the list of all their bought application (mapping table)
- Nhibernate throws Object of type 'System.Linq.EnumerableQuery`1[Entity]' cannot be converted to type 'System.Linq.IQueryable`1[System.Object[]]'
- how to prevent adding of namespaces to child nodes of root when namespaces are required only in root
- C# Linq from DataTable
- LinQ optimization