daily pastebin goal
42%
SHARE
TWEET

Untitled

a guest Jan 11th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public final class SqlUtils {
  2.     public static String removeAcentos(String texto) {
  3.             return texto.replaceAll("[áàãâä]", "a")
  4.                 .replaceAll("[ÁÀÃÂÄ]", "A")
  5.                 .replaceAll("[éèêë]", "e")
  6.                 .replaceAll("[ÉÈÊË]", "E")
  7.                 .replaceAll("[íìîï]", "i")
  8.                 .replaceAll("[ÍÌÎÏ]", "I")
  9.                 .replaceAll("[óòõôö]", "o")
  10.                 .replaceAll("[ÓÒÕÔÖ]", "O")
  11.                 .replaceAll("[úùûü]", "u")
  12.                 .replaceAll("[ÚÙÛÜ]", "U")
  13.                 .replaceAll("[ñ]", "n")
  14.                 .replaceAll("[Ñ]", "N")
  15.                 .replaceAll("[ç]", "c")
  16.                 .replaceAll("[Ç]", "C")
  17.                 .replaceAll("[ÿý]", "y")
  18.                 .replaceAll("[Ý]", "Y");
  19.     }
  20. }
  21.    
  22. CREATE FUNCTION removeAcentos(texto VARCHAR(100))
  23. RETURNS Varchar(100)
  24. LANGUAGE JAVA
  25. PARAMETER STYLE JAVA
  26. NO SQL
  27. EXTERNAL NAME 'sqlutils.SqlUtils.removeAcentos'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top