Here you can find the source of normalizeEnglishIdentifier(String id)
Parameter | Description |
---|---|
id | The string to be worked |
public static String normalizeEnglishIdentifier(String id)
//package com.java2s; //License from project: Open Source License import java.text.Normalizer; public class Main { /**//from w w w . ja v a2 s. c o m * Remove anything that is not English letters or digits from the string and convert what wasn't removed to lower case. * Accents are also removed from letters. * @param id The string to be worked * @return A string that matches {@code /^[a-zA-Z0-9]*$/}, note that it may be empty */ public static String normalizeEnglishIdentifier(String id) { return Normalizer.normalize(id, Normalizer.Form.NFD).replaceAll("[^a-zA-Z0-9]", "") //.replaceAll("\\p{Blank}+", " ") .toLowerCase(); } }