# Serial substitution

**URL:** <https://community.silverfin.com/t/serial-substitution/1005>\
**Category:** Templates\
**Tags:** variables, capture\
**Created:** [June 18, 2018, 3:25pm UTC](https://community.silverfin.com/t/serial-substitution/1005 "2018-06-18T15:25:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bart\_Verhaeghe](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@Bart\_Verhaeghe](https://community.silverfin.com/u/Bart_Verhaeghe)\
**Post date:** [June 18, 2018, 3:25pm UTC](https://community.silverfin.com/t/serial-substitution/1005/1 "2018-06-18T15:25:41Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [June 19, 2018, 8:13am UTC](https://community.silverfin.com/t/serial-substitution/1005/2 "2018-06-19T08:13:45Z")

</div>

Hey @Bart_Verhaeghe,

By using another capture I’m thinking:

```auto
    {% 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.
