title: Substitute values in a string with placeholders in Scala
body: <p>I have just started using Scala and wish to better understand the functional approach to problem solving.
  I have pairs of strings the first has placeholders for parameter and it's pair has the values to substitute. e.g.
  "select col1 from tab1 where id > $1 and name like $2"
  "parameters: $1 = '250', $2 = 'some%'"</p>
  
  <p>There may be many more than 2 parameters.</p>
  
  <p>I can build the correct string by stepping through and using regex.findAllIn(line) on each line and then going through the iterators to construct the substitution but this seems fairly inelegant and procedurally driven.</p>
  
  <p>Could anyone point me towards a functional approach that will be neater and less error prone?</p>