Skip to content

IEnumerable.skip() method

Marcel Kloubert edited this page Sep 25, 2015 · 2 revisions

IEnumerable->skip($count) method

Skips a number of elements (s. Skip()).

Syntax

public function skip(int $count) : IEnumerable;

Parameters

Name Type Description
$count int The number of elements to skip.

$count

The number of elements to skip.

Result

The current or new sequence.

Examples

use \System\Linq\Enumerable;

$seq = Enumerable::create([239, 5979, 22]);

foreach ($seq->skip(1) as $item) {
    // [0] 5979
    // [1] 22
}
Clone this wiki locally