Created
August 3, 2022 03:36
-
-
Save NahianAhmed/7956c1af336a97dc7f2049da37b606e8 to your computer and use it in GitHub Desktop.
Remove Carriage return, Tab , new line in Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String replaceTabAndNewLine(String text, String replacement) { | |
return StringUtils.isNotBlank(text) ? text.replaceAll("[\\r\\t\\n]", replacement) : StringUtils.EMPTY; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment