Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. Hol?a por -> Hol a
  2.  
  3. private String escapaCaracter(String valor) {
  4.  
  5. String valorOk = " ";
  6. try {
  7. valorOk = valor
  8. .replaceAll("/", "-")
  9. .replaceAll("\\", " ")
  10. .replaceAll("¿", " ")
  11. .replaceAll("?", " ")
  12. .replaceAll("#", " ")
  13. .replaceAll("<", " ")
  14. .replaceAll(">", " ")
  15. .replaceAll("[", " ")
  16. .replaceAll("]", " ")
  17. .replaceAll("{", " ")
  18. .replaceAll("}", " ");
  19. } catch (Exception e) {
  20. if (s_log.isLoggable(Level.FINEST)) {
  21. s_log.log(Level.FINEST, "Ha fallado el escapaCaracter para el valor: " + valor);
  22. }
  23. }
  24.  
  25. return valorOk;
  26. }
  27.  
  28. java.util.regex.PatternSyntaxException: Dangling meta character '?' near index 0
  29. ?
  30. ^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement