Package tech.mgl.core.utils
Class MGL_StringUtils
java.lang.Object
org.apache.commons.lang3.StringUtils
tech.mgl.core.utils.MGL_StringUtils
public class MGL_StringUtils
extends org.apache.commons.lang3.StringUtils
-
Field Summary
Fields inherited from class org.apache.commons.lang3.StringUtils
CR, EMPTY, INDEX_NOT_FOUND, LF, SPACE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringconvertCamelStringToPath(String input) Converts a camelCase string to a path (e.g., "camelCaseString" -> "camel/case/string").static StringgetFirstNonEmptyString(String... strings) Returns the first non-empty string from the given parameters.static StringinputStream2String(InputStream inStream) Converts an InputStream to a String.static voidqueryDigits(String str) Extracts all digits from the input string and returns them as a list of strings.static InputStreamstring2inputStream(String str) Converts a String to an InputStream.static StringRemoves all whitespace characters from the given string.Methods inherited from class org.apache.commons.lang3.StringUtils
abbreviate, abbreviate, abbreviate, abbreviate, abbreviateMiddle, appendIfMissing, appendIfMissingIgnoreCase, capitalize, center, center, center, chomp, chomp, chop, compare, compare, compareIgnoreCase, compareIgnoreCase, contains, contains, containsAny, containsAny, containsAny, containsAnyIgnoreCase, containsIgnoreCase, containsNone, containsNone, containsOnly, containsOnly, containsWhitespace, countMatches, countMatches, defaultIfBlank, defaultIfEmpty, defaultString, defaultString, deleteWhitespace, difference, endsWith, endsWithAny, endsWithIgnoreCase, equals, equalsAny, equalsAnyIgnoreCase, equalsIgnoreCase, firstNonBlank, firstNonEmpty, getBytes, getBytes, getCommonPrefix, getDigits, getFuzzyDistance, getIfBlank, getIfEmpty, getJaroWinklerDistance, getLevenshteinDistance, getLevenshteinDistance, indexOf, indexOf, indexOf, indexOf, indexOfAny, indexOfAny, indexOfAny, indexOfAnyBut, indexOfAnyBut, indexOfDifference, indexOfDifference, indexOfIgnoreCase, indexOfIgnoreCase, isAllBlank, isAllEmpty, isAllLowerCase, isAllUpperCase, isAlpha, isAlphanumeric, isAlphanumericSpace, isAlphaSpace, isAnyBlank, isAnyEmpty, isAsciiPrintable, isBlank, isEmpty, isMixedCase, isNoneBlank, isNoneEmpty, isNotBlank, isNotEmpty, isNumeric, isNumericSpace, isWhitespace, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, joinWith, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOfAny, lastIndexOfIgnoreCase, lastIndexOfIgnoreCase, lastOrdinalIndexOf, left, leftPad, leftPad, leftPad, length, lowerCase, lowerCase, mid, normalizeSpace, ordinalIndexOf, overlay, prependIfMissing, prependIfMissingIgnoreCase, remove, remove, removeAll, removeEnd, removeEndIgnoreCase, removeFirst, removeIgnoreCase, removePattern, removeStart, removeStart, removeStartIgnoreCase, repeat, repeat, repeat, replace, replace, replaceAll, replaceChars, replaceChars, replaceEach, replaceEachRepeatedly, replaceFirst, replaceIgnoreCase, replaceIgnoreCase, replaceOnce, replaceOnceIgnoreCase, replacePattern, reverse, reverseDelimited, right, rightPad, rightPad, rightPad, rotate, split, split, split, split, splitByCharacterType, splitByCharacterTypeCamelCase, splitByWholeSeparator, splitByWholeSeparator, splitByWholeSeparatorPreserveAllTokens, splitByWholeSeparatorPreserveAllTokens, splitPreserveAllTokens, splitPreserveAllTokens, splitPreserveAllTokens, splitPreserveAllTokens, startsWith, startsWithAny, startsWithIgnoreCase, strip, strip, stripAccents, stripAll, stripAll, stripEnd, stripStart, stripToEmpty, stripToNull, substring, substring, substringAfter, substringAfter, substringAfterLast, substringAfterLast, substringBefore, substringBefore, substringBeforeLast, substringBetween, substringBetween, substringsBetween, swapCase, toCodePoints, toEncodedString, toRootLowerCase, toRootUpperCase, toString, trim, trimToEmpty, trimToNull, truncate, truncate, uncapitalize, unwrap, unwrap, upperCase, upperCase, valueOf, wrap, wrap, wrapIfMissing, wrapIfMissing
-
Constructor Details
-
MGL_StringUtils
public MGL_StringUtils()
-
-
Method Details
-
getFirstNonEmptyString
Returns the first non-empty string from the given parameters.- Parameters:
strings- The variable number of strings to check- Returns:
- The first non-empty string, or null if all are empty
-
trimAll
Removes all whitespace characters from the given string.- Parameters:
str- The input string- Returns:
- The string without any whitespace
-
inputStream2String
Converts an InputStream to a String.- Parameters:
inStream- The input stream to convert- Returns:
- The string representation of the InputStream
- Throws:
IOException- If an I/O error occurs
-
string2inputStream
Converts a String to an InputStream.- Parameters:
str- The string to convert- Returns:
- The InputStream representation of the String
-
convertCamelStringToPath
Converts a camelCase string to a path (e.g., "camelCaseString" -> "camel/case/string").- Parameters:
input- The camelCase string- Returns:
- The path-like string with slashes separating words
-
queryDigits
Extracts all digits from the input string and returns them as a list of strings.- Parameters:
str- The input string- Returns:
- A list of digit strings found in the input
-
main
-