Example usage for Java org.springframework.util StringUtils fields, constructors, methods, implement or subclass
The text is from its open source code.
String[] | addStringToArray(@Nullable String[] array, String str) Append the given String to the given String array, returning a new array consisting of the input array contents plus the given String . |
String | applyRelativePath(String path, String relativePath) Apply the given relative path to the given Java resource path, assuming standard Java folder separation (i.e. |
String | arrayToCommaDelimitedString(@Nullable Object[] arr) Convert a String array into a comma delimited String (i.e., CSV). |
String | arrayToDelimitedString(@Nullable Object[] arr, String delim) Convert a String array into a delimited String (e.g. |
String | capitalize(String str) Capitalize a String , changing the first letter to upper case as per Character#toUpperCase(char) . |
String | cleanPath(String path) Normalize the path by suppressing sequences like "path/.." |
String | collectionToCommaDelimitedString(@Nullable Collection> coll) Convert a Collection into a delimited String (e.g., CSV). |
String | collectionToDelimitedString(@Nullable Collection> coll, String delim) Convert a Collection into a delimited String (e.g. |
String | collectionToDelimitedString(@Nullable Collection> coll, String delim, String prefix, String suffix) Convert a Collection to a delimited String (e.g. |
Set | commaDelimitedListToSet(@Nullable String str) Convert a comma delimited list (e.g., a row from a CSV file) into a set. |
String[] | commaDelimitedListToStringArray(@Nullable String str) Convert a comma delimited list (e.g., a row from a CSV file) into an array of strings. |
String[] | concatenateStringArrays(@Nullable String[] array1, @Nullable String[] array2) Concatenate the given String arrays into one, with overlapping array elements included twice. |
boolean | containsWhitespace(@Nullable CharSequence str) Check whether the given CharSequence contains any whitespace characters. |
boolean | containsWhitespace(@Nullable String str) Check whether the given String contains any whitespace characters. |
int | countOccurrencesOf(String str, String sub) Count the occurrences of the substring sub in string str . |
String | delete(String inString, String pattern) Delete all occurrences of the given substring. |
String | deleteAny(String inString, @Nullable String charsToDelete) Delete any character in a given String . |
String[] | delimitedListToStringArray(@Nullable String str, @Nullable String delimiter) Take a String that is a delimited list and convert it into a String array. |
String[] | delimitedListToStringArray(@Nullable String str, @Nullable String delimiter, @Nullable String charsToDelete) Take a String that is a delimited list and convert it into a String array. |
boolean | endsWithIgnoreCase(@Nullable String str, @Nullable String suffix) Test if the given String ends with the specified suffix, ignoring upper/lower case. |
String | getFilename(@Nullable String path) Extract the filename from the given Java resource path, e.g. |
String | getFilenameExtension(@Nullable String path) Extract the filename extension from the given Java resource path, e.g. |
boolean | hasLength(@Nullable CharSequence str) Check that the given CharSequence is neither null nor of length 0. |
boolean | hasLength(@Nullable String str) Check that the given String is neither null nor of length 0. |
boolean | hasText(@Nullable CharSequence str) Check whether the given CharSequence contains actual text. |
boolean | hasText(@Nullable String str) Check whether the given String contains actual text. |
boolean | isEmpty(@Nullable Object str) Check whether the given object (possibly a String ) is empty. |
String[] | mergeStringArrays(@Nullable String[] array1, @Nullable String[] array2) Merge the given String arrays into one, with overlapping array elements only included once. |
Locale | parseLocale(String localeValue) Parse the given String value into a Locale , accepting the Locale#toString format as well as BCP 47 language tags. |
Locale | parseLocaleString(String localeString) Parse the given String representation into a Locale . |
TimeZone | parseTimeZoneString(String timeZoneString) Parse the given timeZoneString value into a TimeZone . |
boolean | pathEquals(String path1, String path2) Compare two paths after normalization of them. |
String | quote(@Nullable String str) Quote the given String with single quotes. |
Object | quoteIfString(@Nullable Object obj) Turn the given Object into a String with single quotes if it is a String ; keeping the Object as-is else. |
String | replace(String inString, String oldPattern, @Nullable String newPattern) Replace all occurrences of a substring within a string with another string. |
String[] | split(@Nullable String toSplit, @Nullable String delimiter) Split a String at the first occurrence of the delimiter. |
Properties | splitArrayElementsIntoProperties(String[] array, String delimiter) Take an array of strings and split each element based on the given delimiter. |
boolean | startsWithIgnoreCase(@Nullable String str, @Nullable String prefix) Test if the given String starts with the specified prefix, ignoring upper/lower case. |
String | stripFilenameExtension(String path) Strip the filename extension from the given Java resource path, e.g. |
boolean | substringMatch(CharSequence str, int index, CharSequence substring) Test whether the given string matches the given substring at the given index. |
String[] | tokenizeToStringArray(@Nullable String str, String delimiters) Tokenize the given String into a String array via a StringTokenizer . |
String[] | tokenizeToStringArray(@Nullable String str, String delimiters, boolean trimTokens, boolean ignoreEmptyTokens) Tokenize the given String into a String array via a StringTokenizer . |
String | toLanguageTag(Locale locale) Determine the RFC 3066 compliant language tag, as used for the HTTP "Accept-Language" header. |
String[] | toStringArray(@Nullable Collection Copy the given Collection into a String array. |
String[] | toStringArray(@Nullable Enumeration Copy the given Enumeration into a String array. |
String | trimAllWhitespace(String str) Trim all whitespace from the given String : leading, trailing, and in between characters. |
String[] | trimArrayElements(String[] array) Trim the elements of the given String array, calling String.trim() on each of them. |
String | trimLeadingCharacter(String str, char leadingCharacter) Trim all occurrences of the supplied leading character from the given String . |
String | trimLeadingWhitespace(String str) Trim leading whitespace from the given String . |
String | trimTrailingCharacter(String str, char trailingCharacter) Trim all occurrences of the supplied trailing character from the given String . |
String | trimTrailingWhitespace(String str) Trim trailing whitespace from the given String . |
String | trimWhitespace(String str) Trim leading and trailing whitespace from the given String . |
String | uncapitalize(String str) Uncapitalize a String , changing the first letter to lower case as per Character#toLowerCase(char) . |
String | unqualify(String qualifiedName) Unqualify a string qualified by a '.' |