Serial substitution

Hi,

Have a question for the following code:

´´´{% assign str_TestZin = ‘Dit is X_1, de ander is X_2’ %}

{% capture X_1 %}{% input custom.inputs.X1 %}{% endcapture %}
{% capture X_2 %}{% input custom.inputs.X2 %}{% endcapture %}´´´

How can I perform a ‘serial substitute’, whereby X_1 and X_2 in str_TestZin are replaced by the equivalent capture (X_1, respectively X_2)?

So the end result should be ‘Dit is {% input custom.inputs.X1 %}, de ander is {% input custom.inputs.X2 %}’

Thanks!

Hey @Bart_Verhaeghe,

By using another capture I’m thinking:

    {% capture X_1 %}{% input custom.inputs.X1 %}{% endcapture %}
    {% capture X_2 %}{% input custom.inputs.X2 %}{% endcapture %}

    {% capture main_str %}{% t "This is " %}{{ X_1 }}; {% t "this is " %}{{ X_2 }}{% endcapture %}

    {% comment %}show output{% endcomment %}
    {{ main_str }}

Is this what you’re looking for? In an assign you can’t combine other code, but in a capture you can.