Data matching in Dynamo

Hello,
I am Dynamo beginner and at the moment I do not understand how to match a single string with a list of values.

I have a string “window_” and I would like to merge with a list of integers from 1 to 15, in a way that resulting string looks like the following:
“window_1”, “window_2”, … “window_3”.

However what I get is this:
“window”, “1_2_3_4…15”

Can someone explain to me the logic behind Dynamo’s data matching?
Here is the screenshot of the current issue:

I apologize if my question was not precise enough.

Thank you @Marcel_Rijsmus,

To be sure I understand the principle, and not only the solution:
So “Code blocks” node by default support Shortest Lacing?
While “String.Join” node does not?

its on auto since dynamo 2.x
i dont know the rules that defaults it to shortest or longest or cross poduct
(btw shortest 1 times15 would give the same result as longest 15 times1 in this case) exept for this

2 Likes

Thank you @Marcel_Rijsmus,

I am still puzzled why “String.Join” node does not support the Shortest Lacing while “Code block” node does by default.

Hi @george ,

String.Join concatenates multiple strings (list of strings) into a single string. You can read the description and see examples if you right-click on the node > Help…

What you actually need might be String.Insert, however the best way is the one suggested by @Marcel_Rijsmus

StringInsert

You can find more information about list lacing here:
http://primer.dynamobim.org/06_Designing-with-Lists/6-1_whats-a-list.html

2 Likes

Thank you @lucamanzoni.
It seems I would have to read through the Primer before asking stupid questions.
Thank you for the link as well!

1 Like