title: convert a string to google searchable string in swift
body: <p>I want to open google search for any given string, here is my code, but it does not open the search for the given string for example.</p>
  
  <pre><code>let s = "A long-running line of '80s ads urged potential pizza customers to “avoid” what?"
  let search = s.replacingOccurrences(of: " ", with: "+")
  
  
  
  if let url = URL(string: "https://www.google.com/search?q=\(search)"), NSWorkspace.shared.open(url) {
          print("default browser was successfully opened")
  
      }
  </code></pre>