score:1
Accepted answer
Sequences basically work OK at what they do, which is to provide a simple interface that yields a stream of values on demand. If you have more complicated demands then you're welcome to use a more powerful interface.
For instance, your string examples look like they could benefit being written as a parser: that is, a function that consumes a sequence of characters from a stream and uses internal state to keep track of where it is in the stream.
Source: stackoverflow.com
Related Articles
- Fun things to do with generators and sequences
- What does this C# code with an "arrow" mean and how is it called?
- Generate number sequences with LINQ
- Best practices for dealing with LINQ statements that result in empty sequences and the like?
- Why doesn't this code compile in VS2010 with .NET 4.0?
- Why is this code with PredicateBuilder not working?
- Can you advise me a resource with LINQ/lambda code exercises?
- LINQ Source Code Available
- Linq with where clause in many-to-many EF Code First object
- C# Code Contracts -- How to ensure that a collection of items contains items with unique properties?
- .NET 4 Code Contracts: "requires unproven: source != null"
- C#: Adding Columns To Bound DatagridView With Code
- Query expressions over source type 'dynamic' or with a join sequence of type 'dynamic' are not allowed
- How to query by where clause with EF code first
- How do you deal with sequences of IDisposable using LINQ?
- C# - Linq optimize code with List and Where clause
- compressing code with C# generics
- How do I represent an option calculated column with EF Code First?
- How can I combine IObservable<T>.Throttle() with some other event source using Reactive Extensions?
- creating Linq to sqlite dbml from DbLinq source code
- Stubbing Code for Test With Linq Expressions and Lambdas
- Reuse Linq to SQL code with entityframework
- Replacing loops with linq code
- Linq sub query when using a repository pattern with EF code first
- Linq to sql as object data source - designer problem with partial classes
- Entity Framework Code First String Comparison with Oracle Db
- Is there any way to make Code Contracts work with LINQ?
- LINQ deferred execution with a function's result as source (e.g. Console.ReadLine)
- How can I fetch child entities as DTO in parent using reusable queries/Expression's with EF code first?
- Accessing SQL Server time in code with LINQ
- How to filter and select a List that is an attribute of a class LINQ?
- How to merge C# list records with the records in same list
- How to add XComment on same line as an XElement?
- Linq updating different table after join process
- Linq-to-Entities Dynamic sorting
- Entity Framework many to many complex query unable to create error
- VB.NET Linq query Left outer join left is null
- Using LINQ query on Dictionary and List
- Convert string to int in linq query
- Linq left join when the class on the left side of equals can be null
- Is it possible to do this as a single efficient LINQ query?
- C# Linq to entities - How to select only records which have all references from array
- LinQ into variable without losing reference
- How can convert a For statement into LINQ
- C# MVC4 Linq - Filter table by either date or date + time
- LINQ: How do I concatenate a list of integers into comma delimited string?
- Linq to SQL sort by fields in 2 entities (parent-child)
- How do you use an Nullable<T> parameter with an nHibernate Linq Expression?
- How to concatenate all child elements with same names values using LINQ to XML
- LINQ Splitting and group by resulting property