String transformation

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??

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

1 Like

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.

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

1 Like