title: Difference between String trim() and strip() methods in Java 11
body: <p>Among other changes, JDK 11 introduces 6 new methods for java.lang.String class:</p>
  
  <ul>
  <li><code>repeat(int)</code> - Repeats the String as many times as provided by the <code>int</code> parameter</li>
  <li><code>lines()</code> - Uses a Spliterator to lazily provide lines from the source string</li>
  <li><code>isBlank()</code> - Indicates if the String is empty or contains only white space characters</li>
  <li><code>stripLeading()</code> - Removes the white space from the beginning</li>
  <li><code>stripTrailing()</code> - Removes the white space from the end</li>
  <li><strong><code>strip()</code></strong> - Removes the white space from both, beginning and the end of string   </li>
  </ul>
  
  <p>In particular, <code>strip()</code> looks very similar to <code>trim()</code>. As per <a href="https://dzone.com/articles/applying-new-jdk-11-string-methods" rel="noreferrer">this article</a> <code>strip*()</code> methods are designed to:</p>
  
  <blockquote>
    <p>The String.strip(), String.stripLeading(), and String.stripTrailing()
    methods trim white space [as determined by Character.isWhiteSpace()]
    off either the front, back, or both front and back of the targeted
    String.</p>
  </blockquote>
  
  <p><code>String.trim()</code> JavaDoc states:</p>
  
  <pre><code>/**
    * Returns a string whose value is this string, with any leading and trailing
    * whitespace removed.
    * ...
    */
  </code></pre>
  
  <p>Which is almost identical to the quote above.</p>
  
  <p>What exactly the difference between <code>String.trim()</code> and <code>String.strip()</code> since Java 11?</p>