title: Remove a word from unknown length of string SWIFT
body: <p>I am trying to remove a word from unknown lengh of a string, here is my code. </p>
  
  <pre><code>if (newService.range(of: serviceStr) != nil){
  
      // I should remove selected word here
  
      print("remove selected")
  }else{
      print("add select")
      let space = " , "
      newService = newService + space + serviceStr            
  }
  </code></pre>
  
  <p>I have tried many ways, however, every code I should specify the offsetBy which I dont know because its user buttons selection.</p>