title: Check if string has a space
body: <p>I have a string that contains a url. I am trying to check if the url has a space which is invalid.</p>
  
  <pre><code>let url = "http://www.example.com/images/pretty pic.png"
  </code></pre>
  
  <p>As you can see in this example, there is a space between pretty and pic. Thanks.</p>