Package org.goplanit.utils.misc
Class StringUtils
- java.lang.Object
-
- org.goplanit.utils.misc.StringUtils
-
public class StringUtils extends Object
Some simple string utilities- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description StringUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isNullOrBlank(String string)
Verify if null or blankstatic String
removeEndingStringWhenPresent(String theString, String endString)
Remove the given string from the end of the string if present and return resultstatic String
removeInitialStringWhenPresent(String theString, String initialString)
Remove the given string from the beginning of the string if present and return resultstatic String[]
splitByAnythingExceptAlphaNumeric(String toSplit)
split string by anything but alpha numeric characters, i.e., a-zA-Z0-9
-
-
-
Method Detail
-
splitByAnythingExceptAlphaNumeric
public static String[] splitByAnythingExceptAlphaNumeric(String toSplit)
split string by anything but alpha numeric characters, i.e., a-zA-Z0-9- Parameters:
toSplit
- string to split- Returns:
- split string
-
isNullOrBlank
public static boolean isNullOrBlank(String string)
Verify if null or blank- Parameters:
string
- to verify- Returns:
- true when null or blank
-
removeInitialStringWhenPresent
public static String removeInitialStringWhenPresent(String theString, String initialString)
Remove the given string from the beginning of the string if present and return result- Parameters:
theString
- to alterinitialString
- to remove if present- Returns:
- altered string
-
-