EXCLUDE_ARRAY(2) SYSTEM CALLS EXCLUDE_ARRAY(2)
NAME
exclude_array - "deletes a range from a copy of an array
SYNOPSIS
varargs mixed *exclude_array(mixed *array,int from, int to);
DESCRIPTION
Returns a copy of "array", with elements in the range
[from..to] deleted. The "to" argument may be omitted, in
which case exclude_array will delete the element at "from".
If both arguments are omitted, exclude_array will delete the
first element of a copy of array.
If "from" < 1, the excluded range will begin with the first
element of the array. If "to" >= the number of elements in
the array, the excluded range will run from "from" to the
end of the array.
EXAMPLES
arr = ({ "a", "b", "c", "d", "e" }); exclude_array(arr, 2,
3); // returns ({ "a", "b", "e" }) exclude_array(arr, 2,
25);// returns ({ "a", "b" }) exclude_array(arr, -1, 2);//
returns ({ "d", "e" }) exclude_array(arr, 1); // returns
({ "a", "c", "d", "e" }) exclude_array(arr); //
returns ({ "b", "c", "d", "e" })
NOTE: You probably would never use exclude_array(arr),
since you
could achieve the same results with
arr[1..sizeof(arr)-1],
which would be faster since it does not do a function
call.
AUTHOR
Ichabod@TMI, 1/29/93
MudOS Release 0.9 Last change: 3-19-93