How can I replace spaces in a string with ‘%20’ (for the REST query)

0
I’m sending a REST query and I need to replace spaces in the user input with ‘%20’. I have a string attribute where user input is stored so I can edit this string, how can I detect any spaces in the string and replace them with ‘%20’?
asked
2 answers
4

Hi Maxim, 

You can use Replaceall function in a microflow

replaceAll($variable,’  ‘,’%20’)

I hope this helps

answered
6

If you are sending a rest query, the function urlEncode($yourvariable) should do the trick for every special characters, including spaces.

 

If you only want to replace the blank space youn can try replaceAll : https://docs.mendix.com/refguide/string-function-calls#13-replaceall

 

answered