array->contains returns true if the method's parameter is contained in the array or false otherwise.
This tag performs the same operation as the contains symbol >> with an array on the left-hand side.
if( array->contains(value) ) => { }
In this example we check to see if a particular name is in an array of names.
Code
var(myNames = array('Sean', 'Jono', 'Jess', 'Eric', 'Kyle'))
//test for Jess
if( $myNames->contains('Jess') ) => {^
'Jess is in the list'
else
'Jess is not in the list'
^}
Result
Jess is in the list
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Recent Comments