title: How to remove leading and trailing whitespace from the string in Java?
body: <p>I want to remove the leading and trailing whitespace from string:</p>
  
  <pre><code>String s = "          Hello World                    ";
  </code></pre>
  
  <p>I want the result to be like:</p>
  
  <pre><code>s == "Hello world";
  </code></pre>