File tree 1 file changed +4
-6
lines changed
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -1661,21 +1661,19 @@ end
1661
1661
nth(n::Integer)
1662
1662
1663
1663
Return a function that gets the `n`-th element from any iterator passed to it.
1664
- Throw a `BoundsError`[@ref] if not existing.
1665
-
1666
- Fixes the second element. Equivalent to `Base.Fix2(nth, n)`.
1667
- Will advance any `Stateful`[@ref] iterator.
1664
+ Equivalent to `Base.Fix2(nth, n)` or `itr -> nth(itr, n)`.
1668
1665
1669
1666
See also: [`nth`](@ref), [`Base.Fix2`](@ref)
1670
1667
# Examples
1671
1668
```jldoctest
1672
1669
julia> fifth_element = Iterators.nth(5)
1673
- (::Base.Fix2{typeof(nth), Int64}) (generic function with 1 method )
1670
+ (::Base.Fix2{typeof(Base.Iterators. nth), Int64}) (generic function with 2 methods )
1674
1671
1675
1672
julia> fifth_element(reshape(1:30, (5,6)))
1676
1673
5
1677
1674
1678
- julia> map(Iterators.nth(3), my_vec)
1675
+ julia> map(fifth_element, ("Willis", "Jovovich", "Oldman"))
1676
+ ('i', 'v', 'a')
1679
1677
```
1680
1678
"""
1681
1679
nth (n:: Integer ) = Base. Fix2 (nth, n)
You can’t perform that action at this time.
0 commit comments