All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.deepdreams.worker.api.util.StringToolkit Maven / Gradle / Ivy

There is a newer version: 0.1.1-RELEASE
Show newest version
package tech.deepdreams.worker.api.util;

import java.util.HashMap;
import java.util.Map;

public class StringToolkit {
	private static StringToolkit stringToolkit;
	
	private StringToolkit(){
		
	}
	
	public static StringToolkit getInstance(){
		if(stringToolkit == null)
			stringToolkit = new StringToolkit();
		return stringToolkit;
	}

	public String removeSpecialChars(String word){
		Map map = new HashMap ();
		String newWord = word ;
		newWord = newWord.replaceAll("é", "e");
		newWord = newWord.replaceAll("é".toUpperCase(), "e".toUpperCase());
		newWord = newWord.replaceAll("à", "a");
		newWord = newWord.replaceAll("à".toUpperCase(), "a".toUpperCase());
		newWord = newWord.replaceAll("è", "e");
		newWord = newWord.replaceAll("è".toUpperCase(), "e".toUpperCase());
		newWord = newWord.replaceAll("'", " ");
		newWord = newWord.replaceAll("’", " ");
		newWord = newWord.replaceAll("-", " ");
		newWord = newWord.replaceAll("\\.", "");
		return newWord ;
	}	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy