"Sputnik" help  
Sputnik Help
TakeWhile(<array>, <queryStm>)

Description

Creates a new array containing elements from the beginning of the input array while the specified query statement evaluates to true.

Parameters

<array> The array from which to take elements.
<queryStm> The query statement to evaluate for each array element.

Return Value

Success: Returns a new array containing elements from the beginning of the input array while the query statement is true.
Failure: Returns an empty array.

Remarks

The TakeWhile function is useful for creating a new array that contains elements while a specific condition holds true.

Make sure to read about the ->> and the =>> operators which are very often used in Linq statements.

Related

Example

Example of usage:

my $a = array("Cat7", "Dog7", "Fox6", "Meow6");
printr $a->>TakeWhile($p => Contains($p, 7));
// PRINTS
// Array
// (
//     [0] => Cat7
//     [1] => Dog7
// )

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org