Java String Normalize normalize(String string)

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

Description

normalize

License

Open Source License

Declaration

public static String normalize(String string) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.Normalizer;

import java.util.regex.Pattern;

public class Main {
    public static String normalize(String string) {
        if (string != null) {
            Pattern pattern = Pattern.compile("\\p{InCombiningDiacriticalMarks}+");
            String decomposed = Normalizer.normalize(string, Normalizer.Form.NFD);
            return pattern.matcher(decomposed).replaceAll("");
        } else {//from w  w  w .ja v a 2s  . c  om
            return null;
        }
    }
}

Related

  1. normalize(String s)
  2. normalize(String s)
  3. normalize(String s)
  4. normalize(String string)
  5. normalize(String string)
  6. normalize(String text)
  7. normalize(String text)
  8. normalize(String text)
  9. normalize(String text)