Convert tpl template to twig template I have file tpl in drupal 7 like this:

&lt;div class="&lt;?php print $classes; ?&gt;" &lt;?php { print $attributes; } ?&gt;&gt;
    &lt;?php 
    $content_section = '&lt;div class="'.$container_class.'"&gt;';
    foreach($columns as $key =&gt; $column) {
      $content_section .= render($column);
    }
    $content_section .='&lt;/div&gt;';
    if(isset($customHTML)){
      $customHTML = str_replace('[content]', $content_section, $customHTML);
      print $customHTML;
    }
    else {
      print $content_section;
    }?&gt;
&lt;/div&gt;


I want convert two twig template. But i have problem with function render() and str_replace(). I know in twig have function replace. But don't know how to convert to twig.
In Drupal 8 you can use the drupal |render twig filter:

{{ myvar|render }}


Replace might be used as:

{% set customHTML = customHTML|replace({'[content]': content_section}) %}


having the variables all ready.

To convert your whole template to twig have a look at loops, also.