title: Replace multiple characters from string without using any nested replace functions
body: <p>I have an equation stored in my table. I am fetching one equation at a time and want to replace all the operators with any other character. </p>
  
  <p><strong>Input String:</strong> <code>(N_100-(6858)*(6858)*N_100/0_2)%N_35</code></p>
  
  <p><strong>Operators or patterns:</strong> <code>(+, -, *, /, %, (, ))</code> </p>
  
  <p><strong>Replacement character:</strong> <code>~</code></p>
  
  <p><strong>Output String:</strong> <code>~N_100~~6858~~~6858~~N_100~0_2~~N_35</code></p>
  
  <p>I had tried below query with <strong>Nested REPLACE</strong> Functions and I got desired output: </p>
  
  <pre><code>DECLARE @NEWSTRING VARCHAR(100) 
  SET @NEWSTRING = '(N_100-(6858)*(6858)*N_100/0_2)%N_35' ;
  SELECT @NEWSTRING = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
                      @NEWSTRING, '+', '~'), '-', '~'), '*', '~'), '/', '~')
                     , '%', '~'), '(', '~'), ')', '~')
  PRINT @NEWSTRING
  </code></pre>
  
  <p><strong>Output:</strong> <code>~N_100~~6858~~~6858~~N_100~0_2~~N_35</code></p>
  
  <p>How can I replace all the operators without using nested replace functions?</p>