Class StringUtilsEx

java.lang.Object
org.apache.commons.lang3.StringUtils
host.anzo.commons.utils.StringUtilsEx

public class StringUtilsEx extends org.apache.commons.lang3.StringUtils
Since:
2/6/2023
  • 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 boolean
    matches(String string, String regex)
    Check specified string for regex pattern matching
    static boolean
    matches(String string, @NotNull Pattern pattern)
    Check specified string for regex pattern matching
    static String
    replaceRegexp(String string, String regex, String replacement)
    Replace matches found by specified regexp in string
    static @NotNull String
    trimNBSP(@NotNull String input)
    Remove all whitespaces/tabs and special symbols like   and ‬

    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

    • StringUtilsEx

      public StringUtilsEx()
  • Method Details

    • trimNBSP

      @NotNull public static @NotNull String trimNBSP(@NotNull @NotNull String input)
      Remove all whitespaces/tabs and special symbols like   and ‬
      Parameters:
      input - input string
      Returns:
      trim string
    • matches

      public static boolean matches(String string, String regex)
      Check specified string for regex pattern matching
      Parameters:
      string - string to check
      regex - regexp pattern string representation
      Returns:
      true if string matches a pattern, false otherwise
    • matches

      public static boolean matches(String string, @NotNull @NotNull Pattern pattern)
      Check specified string for regex pattern matching
      Parameters:
      string - string to check
      pattern - regex pattern
      Returns:
      true if string matches a pattern, false otherwise
    • replaceRegexp

      public static String replaceRegexp(String string, String regex, String replacement)
      Replace matches found by specified regexp in string
      Parameters:
      string - input string
      regex - regexp pattern string representation
      replacement - string to replace with
      Returns:
      string with replacements