remove from array

Bill Baxter dnewsgroup at billbaxter.com
Tue Feb 27 15:42:53 PST 2007


BCS wrote:
> Reply to Thorsten,
> 
>> How can I remove values from an array ?
>>
> 
> <totaly untested code>
> 
> T[] Remove(T)(T[] arr, int i)
> {
>   return i==arr.length-1 ? arr[0..$-1] : arr[0..i] ~ arr[i+1 .. $];
> }
> 
> 

This has the function you're looking for and a number of others you'll 
probably be looking for soon after.  :-)

http://www.dsource.org/projects/cashew/browser/trunk/cashew/utils/array.d

--bb



More information about the Digitalmars-d mailing list