remove from array

Bill Baxter dnewsgroup at billbaxter.com
Tue Feb 27 15:45:21 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 .. $];
> }
> 
> 

Using ~ works, but it's slower than using memmorve (what's in Cashew utils).

--bb



More information about the Digitalmars-d mailing list