Combining lists' values to new list

I have 2 lists and I’d like to combine those values into a new same length list.

list 1:
400
500
600

list 2:
120
140
160

separator: “x”
new list:
400x120
500x140
600x160

I thought list.cartesianProduct should do that, but I get ‘null’ …

It’s easier than you might think, you just need to first convert from an int to a string, after that you can concatenate like this:

Type this in a code block:

a+“x”+b;

and plug your inputs in…

OK, too late :smirk:

Please see also here:
http://dynamoprimer.com/en/07_Code-Block/7-3_shorthand.html

1 Like

Thanks both of you!

Yna you got ninja’d :grin:

1 Like

The String.Join should have been the obvious choice here, but it acts different than most other nodes. It joins the strings in each sublist when you normally would expect it to combine the two lists. To make it work in this case, you have would have to transpose the list or use List.Combine:

1 Like