digitalmars.D.learn - 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?
Mar 23 2019
On Saturday, 23 March 2019 at 09:25:52 UTC, Andrey wrote:Hello, I have got 2 simple arrays with the same length:for example via assocArray https://dlang.org/library/std/array/assoc_array.htmlint[] 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?
Mar 23 2019