remove from array
Chris Nicholson-Sauls
ibisbasenji at gmail.com
Wed Feb 28 14:44:11 PST 2007
Bill Baxter wrote:
> 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
Hmm, wow, I really need to revisit Cashew... think I'll go do that now. :) So much left
unfinished and unwritten on there. Bad me. But thanks for the promotion. Good to know
I'm not the only one who uses it.
-- Chris Nicholson-Sauls
More information about the Digitalmars-d
mailing list