score:1
list<string> result = dtfilter.asenumerable()
.select(r => r.field<string>(0))
.select(s => s.replace("0", " "))
.tolist();
score:1
var result = dtfilter
.asenumerable()
.select(r => r.field<string>(0))
.select(s => string.join("",
s.select((x, i) => x == '1'
? (i+1).tostring()
: " "))
);
Source: stackoverflow.com
Related Query
- LINQ Select DataRow from DataTable
- LinQ query select DataRow from DataTable
- select case in Datatable datarow in Linq
- Datatable LINQ select datarow only returning one row and how to order
- Linq to check if the datarow exists in a datatable
- How to get datarow array refering to datatable 's field value with linq
- Datatable datarow in Linq
- Unable to cast object of type grouping to datarow after i grouped datatable with linq
- LINQ query on a DataTable
- Filling a DataSet or a DataTable from a LINQ query result set
- Linq : select value in a datatable column
- How I can filter a dataTable with Linq to datatable?
- Convert DataRow to Dictionary using LINQ
- Select distinct rows from datatable in Linq
- Some data is missing in the Export to Excel using DataTable and Linq
- Use LINQ to group data from DataTable
- DataTable Select vs LINQ Select
- Using Linq to GroupBy and Sum datatable
- LINQ to map a datatable into a list<MyObject>
- Datatable group by with linq in vb.net
- Fastest way to fill DataTable from LINQ query using DataContext
- LINQ on a DataTable IN a CLR Stored Procedure
- How to find duplicate record using Linq from DataTable
- c # using linq to group by multiple columns in a datatable
- Multiple on clause in LINQ to DataTable Join Query
- How to Use OrderBy in linq for DataTable in asp.net
- Datatable filtering: linq vs filter?
- Linq query to count field in datatable
- Pivot logic LINQ on DataTable
- LINQ sum datatable column where
More Query from same tag
- Union two lists of object but remove duplicates based on different values
- LINQ-to-SQL equivalent to Insert ... Select ... From ...?
- How to order a list by property and group the elements in HTML Razor?
- Getting Rounded Values in the final result of Linq Query
- Help with writing a linq query
- Limit data query and get only last 1000 rows
- .Net Linq to JSON with Newtonsoft JSON library
- How Do I Sort IList<Class>?
- Linq Join 2 tables, the column names are different but the values in the column are the same in both tables
- Linq compare hour
- How to assert (if there are any) duplicates in unit tests?
- Displaying a photo in PictureBox from DB
- Read MemoryCache Or InMemory Automatically for Lookup Tables in Database
- Verify that linq extension methods are called with moq
- I'm having trouble with this linq
- MVC Bulk Edit - Linq to Sql List Save
- Linq - Select Date from DateTime
- Linq to Xml, is it possible to improve this query?
- asp.net c# linq generate list from model base on id from another list
- Optional join with Entity Framework
- Ajax Query Dropdown not populating
- Count non null values in multiple columns with LINQ
- C# & LINQ, Select two (consecutive) items at once
- Specifically increase an ID value depending on A Foreign Key
- How can i get my ListBox working correctly
- Returning KeyValuePair from a Linq Compiled Query
- Unable to save with LINQ when trying to insert record with foreign keys?
- Linq to XML: Finding value of a specific element
- How to do joins in linq to sql?
- LINQ Method Syntax - how to accomplish dynamic Linq statements