-
Google Search Bar
I want to make a Google Search bar in my program, i want it to take the textbox and change that into google's link.
So first put http://www.google.co.uk/search?hl=en&q=
Then change all the spaces to a +
And finally add btnG=Google+Search&meta=
So if i were to type 1 2 3 4
It would give me a string of
http://www.google.co.uk/search?hl=en...G=Search&meta=
Which i could then navigate to. But how do i do this and put all spaces to a +
-
Re: Google Search Bar
Use the "replace" method of the string object which repaces any given substring with a specified replacement.
ie if you had textbox1 which had your search term and textbox2 which holds the amended string you'd want something like :
Code:
TextBox2.Text = "http://www.google.co.uk/search?hl=eng&q+" & TextBox1.Text.Replace(" ", "+") & "G=Google+Search&meta="