Please help me with this question. I thought that Linq works on a collection or an array. How come Linq works on a single string variable.
LINQ To Objects works primarily on IEnumerable<T>
, the canonical interface for sequences of a specified type. System.String
implements IEnumerable<char>
, meaning that it can be viewed as a sequence of characters.
[SerializableAttribute]
[ComVisibleAttribute(true)]
public sealed class String : IComparable,
ICloneable, IConvertible, IComparable<string>, IEnumerable<char>,
IEnumerable, IEquatable<string>
LINQ itself is a pattern, more than anything. It's not restricted to IEnumerable<T>
or IQueryable<T>
for that matter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With