The [staticarray->contains] method 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 a staticarray on the left-hand side.
if( staticarray->contains( element ) ) => { }
In this example we check to see if a particular name is in an array of names.
Code
var(myNames = staticarray('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