title: How do I replace duplicate whitespaces in a String in Kotlin?
body: <p>Say I have a string: <code>"Test    me"</code>.</p>
  
  <p>how do I convert it to: <code>"Test me"</code>?</p>
  
  <p>I've tried using:</p>
  
  <pre><code>string?.replace("\\s+", " ")
  </code></pre>
  
  <p>but it appears that <code>\\s</code> is an illegal escape in Kotlin.</p>