Returns the first element of the collection.
Parameters
Returns
IEnumerable<T> source
T
#### Exception
Type
When
InvalidOperationException
It is an empty collection.
Getting the first element
//IEnumerable<int> source = { 5, 8, 9, 10 } int result = source.Head(); //result = 5
Last updated 5 years ago