Java String Normalize normalize(String value)

Here you can find the source of normalize(String value)

Description

normalize

License

Open Source License

Declaration

public static String normalize(String value) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2012 Huygens ING.//from  w ww .ja  v a2 s.c  o m
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl.html
 * 
 * Contributors:
 *     Huygens ING - initial API and implementation
 ******************************************************************************/

import java.text.Normalizer;
import java.util.regex.Pattern;

public class Main {
    public static String normalize(String value) {
        String temp = Normalizer.normalize(value, Normalizer.Form.NFD);
        Pattern pattern = Pattern.compile("\\p{InCombiningDiacriticalMarks}+");
        return pattern.matcher(temp).replaceAll("");
    }
}

Related

  1. normalize(String text)
  2. normalize(String text)
  3. normalize(String text)
  4. normalize(String text)
  5. normalize(String uri)
  6. normalize(String value, Locale locale)
  7. normalizeCutter(String cutter, int numDigits)
  8. normalizeDose(String dose)
  9. normalizeEnglishIdentifier(String id)