fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10.  
  11. static String lne = "http://w...content-available-to-author-only...e.com/watchvhagsftefgyr\\\bgsffgevdgh";
  12.  
  13. static HashMap<String, String> escapeList = null;
  14.  
  15. static void init() {
  16. escapeList = new HashMap();
  17. escapeList.put("&nbsp;", " ");
  18. escapeList.put("&quot;", "\"");
  19. escapeList.put("&amp;", "&");
  20. escapeList.put("&lt;", "<");
  21. escapeList.put("&gt;", ">");
  22. escapeList.put("&iexcl;", "!");
  23. escapeList.put("&copy;", "(c)");
  24. escapeList.put("&reg;", "(R)");
  25. }
  26.  
  27. public static String escapeHTMLLine(String line) {
  28. if (escapeList == null) {
  29. init();
  30. }
  31. for (String key : escapeList.keySet()) {
  32. line = line.replace(key, (String)escapeList.get(key));
  33. }
  34. return line;
  35. }
  36.  
  37. public static void main (String[] args) throws java.lang.Exception
  38. {
  39. escapeHTMLLine(lne);
  40. }
  41. }
Success #stdin #stdout 0.04s 711168KB
stdin
Standard input is empty
stdout
Standard output is empty