0

I'm working in java and I have a string that contains:

"Tom %26 Jerry"

I get it from a text area. I don't want this, I want:

"Tom & Jerry";

How can I do?

Thank you very much.

Finaly I resolved the problem. I found the solution here How to do URL decoding in Java?

I have done the following:

name = java.net.URLDecoder.decode(name, "UTF-8");
Safira
  • 67
  • 7
  • System.out.println("Tom \u0026 Jerry"); will print "Tom & Jerry" if that's what you're asking – user1762507 May 17 '18 at 15:45
  • sorry maybe my explanation it's not good. I have a string that contains "Tom %26 Jerry" but I don't set it i get from a text area. – Safira May 17 '18 at 15:48
  • 1
    It looks url encoded, if you url decode it you should get the clean string – Juan May 17 '18 at 16:00
  • Thank you very much @Juan, I searched information about this and I have been able to solve the problem. – Safira May 17 '18 at 16:16

0 Answers0