com.github.hoantran.lib.utility.string.StringManipulation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of utility-library Show documentation
Show all versions of utility-library Show documentation
Utility library for JAVA application
/**
* Created by Hoan Tran @ http://hoantran-it.blogspot.com
*
* Any modifications to this file must keep this entire header intact.
*
*/
package com.github.hoantran.lib.utility.string;
import org.apache.commons.lang.StringUtils;
/**
* @author hoan.tran
*/
public class StringManipulation {
public static String removeSpecialCharacter(String text) {
return removeSpecialCharacter(text, StringUtils.EMPTY);
}
public static String removeSpecialCharacter(String text, String keepCharacterList) {
return text.replaceAll("[^a-zA-Z0-9" + keepCharacterList + "]+", "");
}
public static String replaceNewLineByBrTag(String text) {
return text.replaceAll("(\r\n|\n)", "
");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy