replace " " with %

Post your questions and help other users.

Moderator: Martin

Post Reply
Jannis636
Posts: 2
Joined: 14 Oct 2018 21:47

replace " " with %

Post by Jannis636 » 23 Oct 2018 11:14

Why i can not replace an empty string (" ") with another charactor? stringName =replace(stringName, " ", "%"); does not work?!

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: replace " " with %

Post by Desmanto » 23 Oct 2018 11:32

I just try this

Code: Select all

stringName = "";
a = replace(stringName, "", "%");
Put condition debug dialog after it and {a} is %

It can be that your stringName is not really empty. You can try to use encodeURL(stringName) to see if it is really empty.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Jannis636
Posts: 2
Joined: 14 Oct 2018 21:47

Re: replace " " with %

Post by Jannis636 » 24 Oct 2018 13:28

I solved it with
replaceAll(someText, "\\s", "%")

Post Reply