score:133
Accepted answer
yes, you just repeat the from ... in clause:
var words = from str in text
from word in str.split(' ')
select word;
score:18
your query would be re-written as:
var tokens = from x in text
from z in x.split(' ')
select z;
here's a good page that has a couple of side-by-side examples of lambda and query syntax:
score:23
you can use a compound from clause:
var tokens = from s in text
from x in s.split(' ')
select x;
Source: stackoverflow.com
Related Query
- Is there a C# LINQ syntax for the Queryable.SelectMany() method?
- Is there a LINQ syntax for the (T, int) overloads of Where and Select?
- Why the extension method of where for LINQ in this code would print out a single number while it shouldn't print anything at all?
- What's the syntax for this linq expression calling the in method
- Is there a solution that will convert the following LINQ Query Syntax to Method Syntax with Lambdas
- Why the LINQ method `Where` in my code is wrong for string[]?
- Code equivalent to the 'let' keyword in chained LINQ extension method calls
- Is there a LINQ function for getting the longest string in a list of strings?
- What's the equivalent VB.NET syntax for anonymous types in a LINQ statement?
- How to get linq `ForEach` statement to return data on the method call being made for each list object?
- Enumerable.Empty<T>().AsQueryable(); This method supports the LINQ to Entities infrastructure and is not intended to be used directly from your code
- The method ‘Skip’ is only supported for sorted input in LINQ to Entities. The method ‘OrderBy’ must be called before the method ‘Skip’
- Is there any way to create a LINQ query as a variable without having the data source (yet)?
- Paging Error :The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'
- Is there a suggested pattern for using LINQ between the Model & DataAccess Layers in a DDD based Layered Architecture
- Is there a way to capture the index value in a LINQ Where method in C#?
- Is there a wildcard for the .Take method in LINQ?
- LINQ - Writing an extension method to get the row with maximum value for each group
- Problems trying to use GroupBy with multiple properties using the LINQ Method Syntax
- LINQ method syntax for multiple left join
- Determine the source DataContext for a Linq to Sql query
- LINQ query syntax for selectmany + join + let
- Is there a way to specify which extension method to use for extension methods of the same name in different namespaces?
- LINQ syntax for CONTAINS method with an inclusive "filter"
- Is there a Linq method to tell that A is the subset of B?
- Is there a Linq operation to determine whether there are items in a collection who have the same values for a pair of properties?
- Understanding the various options for runtime code generation in C# (Roslyn, CodeDom, Linq Expressions, ...?)
- Linq Method syntax for retrieving single nested child entity
- Cannot build the Test project for LINQ IQueryable Toolkit (IQToolkit) - Code 9009
- Can I use a LINQ IEnumerable result as the data source for a Gtk.TreeView?
More Query from same tag
- Creating SQL Server CE DataContext with Tables at runtime
- Exclude data with LINQ
- Linq to SQL: Why am I getting IDENTITY_INSERT errors?
- Asp.Net Linq and XML query
- Filtering duplicates from a type collection using LINQ
- How does a strongly typed DataContext work?
- LINQ, select one item from one table, multiple items from another table
- Group By using Linq
- LinQ groupby multiply columns and sum c#
- How to refactor a MongoDB .NET LINQ Query that uses a static method in a select statement
- Get max column length for each column in a table represented by a list of Dictionaries
- Cannot assign void to an implicitly-typed local variable
- Cast exception when using IncludeFilter with EF6
- Linq - using multiple variables in a query
- How to use my own methods or write a DbFunction for EF Core querying (EF Core 3.0)
- Retrieving data from the table using LINQ to SQL
- LINQ numeric sort replace non-numeric characters
- Define nested derived table in Entity Framework
- how to check null values in linq left join condition insted in where condition
- Linq join values from two lists
- Filtering DBNull With LINQ
- Chain SelectMany instead of using a JOIN statement
- LINQ pass in value for each iteration
- Linq performance: should I first use `where` or `select`
- DotNet Core , No database provider has been configured for this DbContext
- How to return a path of nodes from a recursive hierarchy given a condition?
- How can i create pagination properly with List<IGrouping<string,Product>>?
- Find the last record based on date
- With PLINQ, how can I set the preferred chunk size when using AsParallel().MaxDegreeOfParallelism(4)?
- Why does Lookup<TKey, TValue>.Grouping class not provide equality overrides?