String transformation


#1

I have a string variable :

Query = "Ionic Pro team";

Now, i want to transform the variable to :

Query = "Ionic+Pro+team";

Is there any built in function to do so?? Or, what algorithm should i use in my user-defined function to do this job??


#2

Try this…
Query = Query.replace(" ", "+")


#3

Where is the original data coming from and why is this transformation needed? If the answer to the first question is “user input” and the answer to the second question has anything to do with URL encoding, a naive replacement such as that suggested in the previous post will be woefully insufficient.


#4

Is this for building up a ‘GET’ query parameter?