Here you can find the source of normalizeString(String token)
public static String normalizeString(String token)
//package com.java2s; //License from project: Apache License import java.util.Arrays; public class Main { private static final char[] CHARACTER_REPLACE_MAPPING = new char[256]; public static String normalizeString(String token) { char[] charArray = token.toCharArray(); char[] toReturn = new char[charArray.length]; int index = 0; for (int i = 0; i < charArray.length; i++) { char x = charArray[i]; if (x < CHARACTER_REPLACE_MAPPING.length) { if (CHARACTER_REPLACE_MAPPING[x] > 0) { toReturn[index++] = CHARACTER_REPLACE_MAPPING[x]; }// w w w . j ava2 s . c o m } } return String.valueOf(Arrays.copyOf(toReturn, index)); } }