fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.net.*;
  4.  
  5. class Main
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. String str = "123+>jo";
  10. String str2 = "http://1.com/23+>jo";
  11. System.out.println(URLEncoder.encode(str));
  12. System.out.println(URLEncoder.encode(str2));
  13. }
  14. }
Success #stdin #stdout 0.03s 245632KB
stdin
Standard input is empty
stdout
123%2B%3Ejo
http%3A%2F%2F1.com%2F23%2B%3Ejo