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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    Converts a camelCase string to a path (e.g., "camelCaseString" -> "camel/case/string").
    static String
    Returns the first non-empty string from the given parameters.
    static String
    Converts an InputStream to a String.
    static void
    main(String[] args)
     
    static List<String>
    Extracts all digits from the input string and returns them as a list of strings.
    Converts a String to an InputStream.
    static String
    Removes 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MGL_StringUtils

      public MGL_StringUtils()
  • Method Details

    • getFirstNonEmptyString

      public static String getFirstNonEmptyString(String... strings)
      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

      public static String trimAll(String str)
      Removes all whitespace characters from the given string.
      Parameters:
      str - The input string
      Returns:
      The string without any whitespace
    • inputStream2String

      public static String inputStream2String(InputStream inStream) throws IOException
      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

      public static InputStream string2inputStream(String str)
      Converts a String to an InputStream.
      Parameters:
      str - The string to convert
      Returns:
      The InputStream representation of the String
    • convertCamelStringToPath

      public static String convertCamelStringToPath(String input)
      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

      public static List<String> queryDigits(String str)
      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

      public static void main(String[] args)