Lasso Soft Inc. > Home

[ array->removeall ]

Method

The [array->removeall] method removes any elements that match the parameter from the array. Accepts a single parameter of any data type. Modifies the array in place, returns no value. If no parameter is specified the array is emptied of all elements.

Note: The specified elements in the array are removed and the indexes of all elements in the array above the index are adjusted down.

  • Syntax
array->removeall( 'search_term' )
Examples
  • Beginner

To find and remove an element from an array:

Use the [array->removeall] method. The following example removes all entries for Friday from an array of the days of the week. The resulting array is output.

Code

var( DaysOfWeek = array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat') )

$DaysOfWeek->removeall('Fri')
//output modified array
$DaysOfWeek

Result

array(Sun, Mon, Tue, Wed, Thu, Sat)

Recent Comments

No Comments found

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. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft