references/sleep-functions/removeAt.md

GitHub

removeAt

Category: Arrays

Source: https://sleep.dashnine.org/manual/removeAt.html


Synopsis

removeAt(@arrray, index, ...)

removes the element located at index from @array.

removeAt(%hash, "index", ...)

removes the element associated with "index" from %hash.

Parameters

@array, %hash - the data structure to remove the referenced elements from

index, ... - the location of the data to remove.

Side Effects / Notes

  • this function will modify the passed in data structure directly.

Examples

Example:

%data = %(a => "apple", b => "boy george", c => 33, p => 'pHEAR');
removeAt(%data, "b", "c");

println(%data);

Output:

%(a => 'apple', p => 'pHEAR')

See Also

&add; &addAll; &remove; &removeAll; &splice