Java String Normalize normalizeString(String str)

Here you can find the source of normalizeString(String str)

Description

normalize String

License

Apache License

Declaration

private static String normalizeString(String str) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

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

public class Main {
    public static final Pattern NORMAL_PATTERN = Pattern.compile("\\p{InCombiningDiacriticalMarks}+");

    private static String normalizeString(String str) {
        return NORMAL_PATTERN.matcher(Normalizer.normalize(str.toLowerCase(), Normalizer.Form.NFD)).replaceAll("")
                .replaceAll("[^A-Za-z0-9]", "");
    }/* www.j a v a 2s .co m*/
}

Related

  1. normalizeMatchup(final String matchup)
  2. normalizePackageNamePart(String name)
  3. normalizeRepositoryName(String input)
  4. normalizeSearchString(String src)
  5. normalizeString(String input)
  6. normalizeString(String token)
  7. normalizeSuffix(String suffix)
  8. normalizeTestAndSplit(String text)
  9. normalizeTibetan(String s)