I have a string from window.location.search and would like to replace every occurence of a character in that word with another character.
Example: http://www.sunyrockland.edu/library/librarian2.htm?subject=Question&print_blank_fields=1&title=Question&print_blank_fields=1&YourName=kh ksd+sdfosdf&status=student&[email protected]&[email protected]&subject=Test&Question=Test+as+to+what +needs+to+get+done+on+this+form.
I would like to replace all the + with a space. How would I go about doing that?
I used string.replace() to do this but only does it for the first +. In a loop it does it for every + after the first = and before the first &. I want it for all +.
Example: http://www.sunyrockland.edu/library/librarian2.htm?subject=Question&print_blank_fields=1&title=Question&print_blank_fields=1&YourName=kh ksd+sdfosdf&status=student&[email protected]&[email protected]&subject=Test&Question=Test+as+to+what +needs+to+get+done+on+this+form.
I would like to replace all the + with a space. How would I go about doing that?
I used string.replace() to do this but only does it for the first +. In a loop it does it for every + after the first = and before the first &. I want it for all +.
Comment