public class WhiteSpaceUtil extends Object
| Constructor and Description |
|---|
WhiteSpaceUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
collapseConsecutiveSpaces(String s)
Collapse all consecutive spaces of the passed String into single spaces
|
static boolean |
isNonEmSpace(char ch)
Checks if a character is white space value that is not em, en or similar special whitespace character.
|
static boolean |
isNonLineBreakSpace(char ch)
Checks if a character is white space value that doesn't cause a newline.
|
static String |
processWhitespaces(String text,
boolean keepLineBreaks,
boolean collapseSpaces)
Processes whitespaces according to provided
keepLineBreaks and collapseSpaces values. |
public static String collapseConsecutiveSpaces(String s)
s - String to collapsepublic static boolean isNonEmSpace(char ch)
ch - the characterpublic static boolean isNonLineBreakSpace(char ch)
ch - the charactertrue, if the character is a white space character, but no newlinepublic static String processWhitespaces(String text, boolean keepLineBreaks, boolean collapseSpaces)
keepLineBreaks and collapseSpaces values.text - string to processkeepLineBreaks - whether to keep line breakscollapseSpaces - whether to collapse spacesCopyright © 1998–2025 Apryse Group NV. All rights reserved.