last
优质
小牛编辑
139浏览
2023-12-01
An optimized version of Sequence#last that returns another StringLikeSequence (or just the last character, if count
is undefined).
Examples
Lazy('foo').last() // => 'o' Lazy('foo').last(2) // sequence: 'oo' Lazy('foo').last(10) // sequence: 'foo' Lazy('foo').toUpperCase().last() // => 'O' Lazy('foo').toUpperCase().last(2) // sequence: 'OO'