March 23, 2019 Build AA from two simple array | ||||
---|---|---|---|---|
| ||||
Hello,
I have got 2 simple arrays with the same length:
> int[] values = [1, 2, 3, 4, 5];
> char[] keys = ['a', 'b', 'c', 'd', 'e'];
> auto result = buildAA(keys, values); // [a: 1, b: 2, c: 3, d: 4, e: 5]
I want to build AA "result" using "values" and "keys". How to do it?
|
March 23, 2019 Re: Build AA from two simple array | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrey | On Saturday, 23 March 2019 at 09:25:52 UTC, Andrey wrote: > Hello, > I have got 2 simple arrays with the same length: >> int[] values = [1, 2, 3, 4, 5]; >> char[] keys = ['a', 'b', 'c', 'd', 'e']; >> auto result = buildAA(keys, values); // [a: 1, b: 2, c: 3, d: 4, e: 5] > > I want to build AA "result" using "values" and "keys". How to do it? for example via assocArray https://dlang.org/library/std/array/assoc_array.html |
Copyright © 1999-2021 by the D Language Foundation