title: VB 2013 Textbox: Replace space with "+"
body: <p>I am creating a web browser in VB 2013 Pro and I have one text box accepting the URLs and searches. Right now this is what code I have for the go button:</p>
  
  <pre><code>'Check if text is a search term.
      If TextBox1.Text.Contains(".") Then
          WebBrowser1.Navigate(TextBox1.Text)
          Timer2.Start()
      Else
          TextBox1.Text.Replace(" ", "+")
          WebBrowser1.Navigate(My.Settings.search &amp; TextBox1.Text)
      End If
  </code></pre>
  
  <p>I have when the go button is clicked, it checks to see if there is a "." in the textbox, this is because searches usually don't have periods in them, URLs do. So if it finds a textbox with a period in it, it will attempt to navigate to it. If it does not find a period in the textbox, it will attempt a search. In the "my.settings.search" I have "<a href="https://duckduckgo.com/?q=" rel="nofollow">https://duckduckgo.com/?q=</a>". I do not know why it is not replacing the spaces with a "+" so the browser can actually navigate and search it. I did search on Google, and all the answers I found just say to use the replace command like I did, and just put a space at the character to replace. Timer2 is just telling the app to put the current URL in the textbox and the application title.</p>
  
  <p>Thanks in advanced!</p>