title: Helm modify a multiline string line by line
body: <p>I have a function which returns a multiline string. This function is called at severale places - so I don't want to modify it.However at one place I need to prefix each line with a character. <br></p>
  <pre><code>{{- define &quot;myfunc&quot; -}}
  aaa
  bbb
  ccc
  ddd
  {{- end -}}
  </code></pre>
  <p>At one place in my templates I need to bind these to a list as elements with prefix &quot;-&quot;</p>
  <p><strong>expected result:</strong></p>
  <pre><code>args:
    - aaa
    - bbb
    - ccc
    - ddd
  </code></pre>
  <p><strong>My attempt 1:</strong></p>
  <pre><code>   args:
       - {{- include &quot;myfunc&quot; . | nindent 8 }} 
  </code></pre>
  <p>result:</p>
  <pre><code> args:
    - 
    aaa
    bbb
    ccc
    ddd
  </code></pre>
  <p><strong>My attempt 2:</strong></p>
  <pre><code>  iterating over it, something like
     args:
       {{- range include &quot;myfunc&quot; . }}
       - {{ . }}
       {{- end }}  
  </code></pre>
  <p>result:</p>
  <pre><code>Error: template : .... range can't iterate over aaa
     bbb
     ccc
     ddd
  </code></pre>
  <p><strong>My actual solution:</strong> <br>
  Just copy the existing function with a bit of modification</p>
  <pre><code>{{- define &quot;myfunc2&quot; -}}
  - aaa
  - bbb
  - ccc
  - ddd
  {{- end -}}
  </code></pre>
  <p>The question is how to bind the original function's result to args? How to apply a modification to each line?</p>