Here you can find the source of removeAccent(String s)
Parameter | Description |
---|---|
s | a parameter |
public static String removeAccent(String s)
//package com.java2s; /*/*from ww w .j a v a 2s.com*/ * Copyright(C) 2016 thuebannhadat.com.vn. All rights reserved. * * This software is the confidential and proprietary information of * thuebannhadat.com.vn. You shall not disclose such Confidential Information * and shall use it only in accordance with the terms of the license * agreement you entered into with thuebannhadat.com.vn. */ import java.text.Normalizer; import java.util.regex.Pattern; public class Main { /** * Bo dau 1 chuoi * * @param s * @return */ public static String removeAccent(String s) { String temp = Normalizer.normalize(s, Normalizer.Form.NFD); Pattern pattern = Pattern.compile("\\p{InCombiningDiacriticalMarks}+"); return pattern.matcher(temp).replaceAll(""); } }