title: How to remove specific line from multi-line string
body: <p>I have below java string as command output</p>
  
  <pre><code>String output = "NIC     Value\n"
                  + "------  -----\n"
                  + "vmn0  on   \n"
                  + "vmn1  on   \n"
                  + "vmn2  on   \n"
                  + "vmn3  on   \n"
                  + "vmn4  on";
  </code></pre>
  
  <p>I want to remove second line with dash from above string. How can I do it?</p>
  
  <p>I tried it using contains method but it is generating blank line after removing second line.</p>
  
  <pre><code> if(output!=null &amp;&amp; output.contains("-"))
              output = output.replace("-","");
  </code></pre>