Originally posted by ford Darcy Jr:
Hi,
I am using URL encode in my servlet program to replace spaces. I need to change the + value with %20. Is there any way to do it since if I use URL encode its outputting "+" instead of "%20".
Thanks.
If you're using
Java 1.4 or later, use String.replaceAll().
encoded = myString.replaceAll(" ", "%20");