Package com.helger.base.string
Class StringRemove
java.lang.Object
com.helger.base.string.StringRemove
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringRemove all occurrences of the passed character from the specified input stringstatic StringRemove all occurrences of the passed character from the specified input stringstatic StringremoveMultiple(String sInputString, char[] aRemoveChars) Optimized remove method that removes a set of characters from an input string!
-
Method Details
-
removeAll
Remove all occurrences of the passed character from the specified input string- Parameters:
sInputString- The input string where the character should be removed. If this parameter isnullor empty, no removing is done.cRemoveChar- The character to be removed.- Returns:
- The input string as is, if the input string is empty or if the remove char is not contained.
-
removeAll
@Nullable public static String removeAll(@Nullable String sInputString, @Nullable String sRemoveString) Remove all occurrences of the passed character from the specified input string- Parameters:
sInputString- The input string where the character should be removed. If this parameter isnullor empty, no removing is done.sRemoveString- The String to be removed. May benullor empty in which case nothing happens.- Returns:
- The input string as is, if the input string is empty or if the remove string is empty or not contained.
-
removeMultiple
@Nonnull public static String removeMultiple(@Nullable String sInputString, @Nonnull char[] aRemoveChars) Optimized remove method that removes a set of characters from an input string!- Parameters:
sInputString- The input string.aRemoveChars- The characters to remove. May not benull.- Returns:
- The version of the string without the passed characters or an empty String if the input
string was
null.
-