Class Strings.MoreStringUtil

java.lang.Object
com.landawn.abacus.util.Strings.MoreStringUtil
Enclosing class:
Strings

public static final class Strings.MoreStringUtil extends Object
  • Method Details

    • substring

      public static u.Optional<String> substring(String str, int inclusiveBeginIndex)
      Returns an empty Optional if inclusiveBeginIndex < 0, otherwise an Optional with String value: str.substring(inclusiveBeginIndex) is returned.
      Parameters:
      str -
      inclusiveBeginIndex -
      Returns:
      See Also:
    • substring

      public static u.Optional<String> substring(String str, char delimiterOfInclusiveBeginIndex)
      Returns an empty Optional if N.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0, otherwise an Optional with String value: str.substring(str.indexOf(delimiterOfInclusiveBeginIndex)) is returned.
      Parameters:
      str -
      delimiterOfInclusiveBeginIndex - inclusiveBeginIndex <- str.indexOf(delimiterOfInclusiveBeginIndex)
      Returns:
      See Also:
    • substring

      public static u.Optional<String> substring(String str, String delimiterOfInclusiveBeginIndex)
      Returns an empty Optional if N.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0, otherwise an Optional with String value: str.substring(str.indexOf(delimiterOfInclusiveBeginIndex)) is returned.
      Parameters:
      str -
      delimiterOfInclusiveBeginIndex - inclusiveBeginIndex <- str.indexOf(delimiterOfInclusiveBeginIndex)
      Returns:
      See Also:
    • substring

      public static u.Optional<String> substring(String str, int inclusiveBeginIndex, int exclusiveEndIndex)
      Returns an empty Optional if inclusiveBeginIndex < 0 ||exclusiveEndIndex <= 0 || inclusiveBeginIndex > exclusiveEndIndex, otherwise an Optional with String value: str.substring(exclusiveBeginIndex, exclusiveEndIndex) is returned.
      Parameters:
      str -
      inclusiveBeginIndex -
      exclusiveEndIndex -
      Returns:
      See Also:
    • substring

      public static u.Optional<String> substring(String str, int inclusiveBeginIndex, char delimiterOfExclusiveEndIndex)
      Parameters:
      str -
      inclusiveBeginIndex -
      delimiterOfExclusiveEndIndex - exclusiveEndIndex <- str.indexOf(delimiterOfExclusiveEndIndex, inclusiveBeginIndex + 1) if inclusiveBeginIndex >= 0
      Returns:
      See Also:
    • substring

      public static u.Optional<String> substring(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex)
      Parameters:
      str -
      inclusiveBeginIndex -
      delimiterOfExclusiveEndIndex - exclusiveEndIndex <- str.indexOf(delimiterOfExclusiveEndIndex, inclusiveBeginIndex + 1) if inclusiveBeginIndex >= 0
      Returns:
      See Also:
    • substring

      public static u.Optional<String> substring(String str, int inclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex)
      Parameters:
      str -
      inclusiveBeginIndex -
      funcOfExclusiveEndIndex - exclusiveEndIndex <- funcOfExclusiveEndIndex.applyAsInt(inclusiveBeginIndex) if inclusiveBeginIndex >= 0
      Returns:
      See Also:
    • substring

      public static u.Optional<String> substring(String str, char delimiterOfInclusiveBeginIndex, int exclusiveEndIndex)
      Parameters:
      str -
      delimiterOfInclusiveBeginIndex - inclusiveBeginIndex <- str.lastIndexOf(delimiterOfInclusiveBeginIndex, exclusiveEndIndex - 1) if exclusiveEndIndex > 0
      exclusiveEndIndex -
      Returns:
      See Also:
    • substring

      public static u.Optional<String> substring(String str, String delimiterOfInclusiveBeginIndex, int exclusiveEndIndex)
      Parameters:
      str -
      delimiterOfInclusiveBeginIndex - inclusiveBeginIndex <- str.lastIndexOf(delimiterOfInclusiveBeginIndex, exclusiveEndIndex - 1) if exclusiveEndIndex > 0
      exclusiveEndIndex -
      Returns:
      See Also:
    • substring

      public static u.Optional<String> substring(String str, IntUnaryOperator funcOfInclusiveBeginIndex, int exclusiveEndIndex)
      Parameters:
      str -
      funcOfInclusiveBeginIndex - inclusiveBeginIndex <- funcOfInclusiveBeginIndex.applyAsInt(exclusiveEndIndex)) if exclusiveEndIndex > 0
      exclusiveEndIndex -
      Returns:
      See Also:
    • substringOrElse

      @Beta public static String substringOrElse(String str, int inclusiveBeginIndex, String defaultStr)
      Returns defaultStr if inclusiveBeginIndex < 0, otherwise an Optional with String value: str.substring(inclusiveBeginIndex) is returned.
      Parameters:
      str -
      inclusiveBeginIndex -
      defaultStr -
      Returns:
      See Also:
    • substringOrElse

      @Beta public static String substringOrElse(String str, char delimiterOfInclusiveBeginIndex, String defaultStr)
      Returns defaultStr if N.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0, otherwise an Optional with String value: str.substring(str.indexOf(delimiterOfInclusiveBeginIndex)) is returned.
      Parameters:
      str -
      delimiterOfInclusiveBeginIndex - inclusiveBeginIndex <- str.indexOf(delimiterOfInclusiveBeginIndex)
      defaultStr -
      Returns:
      See Also:
    • substringOrElse

      @Beta public static String substringOrElse(String str, String delimiterOfInclusiveBeginIndex, String defaultStr)
      Returns defaultStr if N.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0, otherwise an Optional with String value: str.substring(str.indexOf(delimiterOfInclusiveBeginIndex)) is returned.
      Parameters:
      str -
      delimiterOfInclusiveBeginIndex - inclusiveBeginIndex <- str.indexOf(delimiterOfInclusiveBeginIndex)
      defaultStr -
      Returns:
      See Also:
    • substringOrElse

      @Beta public static String substringOrElse(String str, int inclusiveBeginIndex, int exclusiveEndIndex, String defaultStr)
      Returns defaultStr if inclusiveBeginIndex < 0 ||exclusiveEndIndex <= 0 || inclusiveBeginIndex > exclusiveEndIndex, otherwise an Optional with String value: str.substring(exclusiveBeginIndex, exclusiveEndIndex) is returned.
      Parameters:
      str -
      inclusiveBeginIndex -
      exclusiveEndIndex -
      defaultStr -
      Returns:
      See Also:
    • substringOrElse

      @Beta public static String substringOrElse(String str, int inclusiveBeginIndex, char delimiterOfExclusiveEndIndex, String defaultStr)
      Parameters:
      str -
      inclusiveBeginIndex -
      delimiterOfExclusiveEndIndex - exclusiveEndIndex <- str.indexOf(delimiterOfExclusiveEndIndex, inclusiveBeginIndex + 1) if inclusiveBeginIndex >= 0
      defaultStr -
      Returns:
      See Also:
    • substringOrElse

      @Beta public static String substringOrElse(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex, String defaultStr)
      Parameters:
      str -
      inclusiveBeginIndex -
      delimiterOfExclusiveEndIndex - exclusiveEndIndex <- str.indexOf(delimiterOfExclusiveEndIndex, inclusiveBeginIndex + 1) if inclusiveBeginIndex >= 0
      defaultStr -
      Returns:
      See Also:
    • substringOrElse

      @Beta public static String substringOrElse(String str, int inclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex, String defaultStr)
      Parameters:
      str -
      inclusiveBeginIndex -
      funcOfExclusiveEndIndex - exclusiveEndIndex <- funcOfExclusiveEndIndex.applyAsInt(inclusiveBeginIndex) if inclusiveBeginIndex >= 0
      defaultStr -
      Returns:
      See Also:
    • substringOrElse

      @Beta public static String substringOrElse(String str, char delimiterOfInclusiveBeginIndex, int exclusiveEndIndex, String defaultStr)
      Parameters:
      str -
      delimiterOfInclusiveBeginIndex - inclusiveBeginIndex <- str.lastIndexOf(delimiterOfInclusiveBeginIndex, exclusiveEndIndex - 1) if exclusiveEndIndex > 0
      exclusiveEndIndex -
      defaultStr -
      Returns:
      See Also:
    • substringOrElse

      @Beta public static String substringOrElse(String str, String delimiterOfInclusiveBeginIndex, int exclusiveEndIndex, String defaultStr)
      Parameters:
      str -
      delimiterOfInclusiveBeginIndex - inclusiveBeginIndex <- str.lastIndexOf(delimiterOfInclusiveBeginIndex, exclusiveEndIndex - 1) if exclusiveEndIndex > 0
      exclusiveEndIndex -
      defaultStr -
      Returns:
      See Also:
    • substringOrElse

      @Beta public static String substringOrElse(String str, IntUnaryOperator funcOfInclusiveBeginIndex, int exclusiveEndIndex, String defaultStr)
      Parameters:
      str -
      funcOfInclusiveBeginIndex - inclusiveBeginIndex <- funcOfInclusiveBeginIndex.applyAsInt(exclusiveEndIndex)) if exclusiveEndIndex > 0
      exclusiveEndIndex -
      defaultStr -
      Returns:
      See Also:
    • substringOrElseItself

      @Beta public static String substringOrElseItself(String str, int inclusiveBeginIndex)
      Returns the input str if inclusiveBeginIndex < 0, otherwise an Optional with String value: str.substring(inclusiveBeginIndex) is returned.
      Parameters:
      str -
      inclusiveBeginIndex -
      Returns:
      See Also:
    • substringOrElseItself

      @Beta public static String substringOrElseItself(String str, char delimiterOfInclusiveBeginIndex)
      Returns the input str if N.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0, otherwise an Optional with String value: str.substring(str.indexOf(delimiterOfInclusiveBeginIndex)) is returned.
      Parameters:
      str -
      delimiterOfInclusiveBeginIndex - inclusiveBeginIndex <- str.indexOf(delimiterOfInclusiveBeginIndex)
      Returns:
      See Also:
    • substringOrElseItself

      @Beta public static String substringOrElseItself(String str, String delimiterOfInclusiveBeginIndex)
      Returns the input str if N.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0, otherwise an Optional with String value: str.substring(str.indexOf(delimiterOfInclusiveBeginIndex)) is returned.
      Parameters:
      str -
      delimiterOfInclusiveBeginIndex - inclusiveBeginIndex <- str.indexOf(delimiterOfInclusiveBeginIndex)
      Returns:
      See Also:
    • substringOrElseItself

      @Beta public static String substringOrElseItself(String str, int inclusiveBeginIndex, int exclusiveEndIndex)
      Returns the input str if inclusiveBeginIndex < 0 ||exclusiveEndIndex <= 0 || inclusiveBeginIndex > exclusiveEndIndex, otherwise an Optional with String value: str.substring(exclusiveBeginIndex, exclusiveEndIndex) is returned.
      Parameters:
      str -
      inclusiveBeginIndex -
      exclusiveEndIndex -
      Returns:
      See Also:
    • substringOrElseItself

      @Beta public static String substringOrElseItself(String str, int inclusiveBeginIndex, char delimiterOfExclusiveEndIndex)
      Parameters:
      str -
      inclusiveBeginIndex -
      delimiterOfExclusiveEndIndex - exclusiveEndIndex <- str.indexOf(delimiterOfExclusiveEndIndex, inclusiveBeginIndex + 1) if inclusiveBeginIndex >= 0
      Returns:
      See Also:
    • substringOrElseItself

      @Beta public static String substringOrElseItself(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex)
      Parameters:
      str -
      inclusiveBeginIndex -
      delimiterOfExclusiveEndIndex - exclusiveEndIndex <- str.indexOf(delimiterOfExclusiveEndIndex, inclusiveBeginIndex + 1) if inclusiveBeginIndex >= 0
      Returns:
      See Also:
    • substringOrElseItself

      @Beta public static String substringOrElseItself(String str, int inclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex)
      Parameters:
      str -
      inclusiveBeginIndex -
      funcOfExclusiveEndIndex - exclusiveEndIndex <- funcOfExclusiveEndIndex.applyAsInt(inclusiveBeginIndex) if inclusiveBeginIndex >= 0
      Returns:
      See Also:
    • substringOrElseItself

      @Beta public static String substringOrElseItself(String str, char delimiterOfInclusiveBeginIndex, int exclusiveEndIndex)
      Parameters:
      str -
      delimiterOfInclusiveBeginIndex - inclusiveBeginIndex <- str.lastIndexOf(delimiterOfInclusiveBeginIndex, exclusiveEndIndex - 1) if exclusiveEndIndex > 0
      exclusiveEndIndex -
      Returns:
      See Also:
    • substringOrElseItself

      @Beta public static String substringOrElseItself(String str, String delimiterOfInclusiveBeginIndex, int exclusiveEndIndex)
      Parameters:
      str -
      delimiterOfInclusiveBeginIndex - inclusiveBeginIndex <- str.lastIndexOf(delimiterOfInclusiveBeginIndex, exclusiveEndIndex - 1) if exclusiveEndIndex > 0
      exclusiveEndIndex -
      Returns:
      See Also:
    • substringOrElseItself

      @Beta public static String substringOrElseItself(String str, IntUnaryOperator funcOfInclusiveBeginIndex, int exclusiveEndIndex)
      Parameters:
      str -
      funcOfInclusiveBeginIndex - inclusiveBeginIndex <- funcOfInclusiveBeginIndex.applyAsInt(exclusiveEndIndex)) if exclusiveEndIndex > 0
      exclusiveEndIndex -
      Returns:
      See Also:
    • substringAfter

      @Beta public static u.Optional<String> substringAfter(String str, char delimiterOfExclusiveBeginIndex)
      Returns the substring after first delimiterOfExclusiveBeginIndex if it exists, otherwise return null String.
      Parameters:
      str -
      delimiterOfExclusiveBeginIndex -
      Returns:
      See Also:
    • substringAfter

      @Beta public static u.Optional<String> substringAfter(String str, String delimiterOfExclusiveBeginIndex)
      Returns the substring after first delimiterOfExclusiveBeginIndex if it exists, otherwise return null String.
      Parameters:
      str -
      delimiterOfExclusiveBeginIndex -
      Returns:
      See Also:
    • substringAfter

      @Beta public static u.Optional<String> substringAfter(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex)
      Returns the substring after first delimiterOfExclusiveBeginIndex if it exists, otherwise return null String.
      Parameters:
      str -
      delimiterOfExclusiveBeginIndex -
      exclusiveEndIndex -
      Returns:
      See Also:
    • substringAfterLast

      @Beta public static u.Optional<String> substringAfterLast(String str, char delimiterOfExclusiveBeginIndex)
      Returns the substring after last delimiterOfExclusiveBeginIndex if it exists, otherwise return null String.
      Parameters:
      str -
      delimiterOfExclusiveBeginIndex -
      Returns:
      See Also:
    • substringAfterLast

      @Beta public static u.Optional<String> substringAfterLast(String str, String delimiterOfExclusiveBeginIndex)
      Returns the substring after last delimiterOfExclusiveBeginIndex if it exists, otherwise return null String.
      Parameters:
      str -
      delimiterOfExclusiveBeginIndex -
      Returns:
      See Also:
    • substringAfterLast

      @Beta public static u.Optional<String> substringAfterLast(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex)
      Returns the substring after last delimiterOfExclusiveBeginIndex if it exists, otherwise return null String.
      Parameters:
      str -
      delimiterOfExclusiveBeginIndex -
      exclusiveEndIndex -
      Returns:
      See Also:
    • substringAfterAny

      @Beta public static u.Optional<String> substringAfterAny(String str, char... delimitersOfExclusiveBeginIndex)
      Returns the substring after any of delimitersOfExclusiveBeginIndex if it exists, otherwise return null String.
      Parameters:
      str -
      delimitersOfExclusiveBeginIndex -
      Returns:
      See Also:
    • substringAfterAny

      @Beta public static u.Optional<String> substringAfterAny(String str, String... delimitersOfExclusiveBeginIndex)
      Returns the substring after any of delimitersOfExclusiveBeginIndex if it exists, otherwise return null String.
      Parameters:
      str -
      delimitersOfExclusiveBeginIndex -
      Returns:
      See Also:
    • substringBefore

      @Beta public static u.Optional<String> substringBefore(String str, char delimiterOfExclusiveEndIndex)
      Returns the substring before first delimiterOfExclusiveBeginIndex if it exists, otherwise return null String.
      Parameters:
      str -
      delimiterOfExclusiveEndIndex -
      Returns:
      See Also:
    • substringBefore

      @Beta public static u.Optional<String> substringBefore(String str, String delimiterOfExclusiveEndIndex)
      Returns the substring before first delimiterOfExclusiveBeginIndex if it exists, otherwise return null String.
      Parameters:
      str -
      delimiterOfExclusiveEndIndex -
      Returns:
      See Also:
    • substringBefore

      @Beta public static u.Optional<String> substringBefore(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex)
      Returns the substring before first delimiterOfExclusiveBeginIndex if it exists, otherwise return null String.
      Parameters:
      str -
      inclusiveBeginIndex -
      delimiterOfExclusiveEndIndex -
      Returns:
      See Also:
    • substringBeforeLast

      @Beta public static u.Optional<String> substringBeforeLast(String str, char delimiterOfExclusiveEndIndex)
      Returns the substring last first delimiterOfExclusiveBeginIndex if it exists, otherwise return null String.
      Parameters:
      str -
      delimiterOfExclusiveEndIndex -
      Returns:
      See Also:
    • substringBeforeLast

      @Beta public static u.Optional<String> substringBeforeLast(String str, String delimiterOfExclusiveEndIndex)
      Returns the substring last first delimiterOfExclusiveBeginIndex if it exists, otherwise return null String.
      Parameters:
      str -
      delimiterOfExclusiveEndIndex -
      Returns:
      See Also:
    • substringBeforeLast

      @Beta public static u.Optional<String> substringBeforeLast(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex)
      Returns the substring last first delimiterOfExclusiveBeginIndex if it exists, otherwise return null String.
      Parameters:
      str -
      inclusiveBeginIndex -
      delimiterOfExclusiveEndIndex -
      Returns:
      See Also:
    • substringBeforeAny

      @Beta public static u.Optional<String> substringBeforeAny(String str, char... delimitersOfExclusiveEndIndex)
      Returns the substring before any of delimitersOfExclusiveEndIndex if it exists, otherwise return null String.
      Parameters:
      str -
      delimitersOfExclusiveEndIndex -
      Returns:
      See Also:
    • substringBeforeAny

      @Beta public static u.Optional<String> substringBeforeAny(String str, String... delimitersOfExclusiveEndIndex)
      Returns the substring before any of delimitersOfExclusiveEndIndex if it exists, otherwise return null String.
      Parameters:
      str -
      delimitersOfExclusiveEndIndex -
      Returns:
      See Also:
    • substringAfterOrElse

      @Beta public static String substringAfterOrElse(String str, String delimiterOfExclusiveBeginIndex, String defaultStr)
      Returns the substring after first delimiterOfExclusiveBeginIndex if it exists, otherwise return defaultStr.
      Parameters:
      str -
      delimiterOfExclusiveBeginIndex -
      defaultStr -
      Returns:
      See Also:
    • substringAfterLastOrElse

      @Beta public static String substringAfterLastOrElse(String str, String delimiterOfExclusiveBeginIndex, String defaultStr)
      Returns the substring after last delimiterOfExclusiveBeginIndex if it exists, otherwise return defaultStr.
      Parameters:
      str -
      delimiterOfExclusiveBeginIndex -
      defaultStr -
      Returns:
      See Also:
    • substringBeforeOrElse

      @Beta public static String substringBeforeOrElse(String str, String delimiterOfExclusiveEndIndex, String defaultStr)
      Returns the substring before first delimiterOfExclusiveBeginIndex if it exists, otherwise return defaultStr.
      Parameters:
      str -
      delimiterOfExclusiveEndIndex -
      defaultStr -
      Returns:
      See Also:
    • substringBeforeLastOrElse

      @Beta public static String substringBeforeLastOrElse(String str, String delimiterOfExclusiveEndIndex, String defaultStr)
      Returns the substring last first delimiterOfExclusiveBeginIndex if it exists, otherwise return defaultStr.
      Parameters:
      str -
      delimiterOfExclusiveEndIndex -
      defaultStr -
      Returns:
      See Also:
    • substringAfterOrElseItself

      @Beta public static String substringAfterOrElseItself(String str, char delimiterOfExclusiveBeginIndex)
      Returns the substring after first delimiterOfExclusiveBeginIndex if it exists, otherwise return the input str.
      Parameters:
      str -
      delimiterOfExclusiveBeginIndex -
      Returns:
      See Also:
    • substringAfterOrElseItself

      @Beta public static String substringAfterOrElseItself(String str, String delimiterOfExclusiveBeginIndex)
      Returns the substring after first delimiterOfExclusiveBeginIndex if it exists, otherwise return the input str.
      Parameters:
      str -
      delimiterOfExclusiveBeginIndex -
      Returns:
      See Also:
    • substringAfterOrElseItself

      @Beta public static String substringAfterOrElseItself(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex)
      Returns the substring after first delimiterOfExclusiveBeginIndex if it exists, otherwise return the input str.
      Parameters:
      str -
      delimiterOfExclusiveBeginIndex -
      exclusiveEndIndex -
      Returns:
      See Also:
    • substringAfterLastOrElseItself

      @Beta public static String substringAfterLastOrElseItself(String str, char delimiterOfExclusiveBeginIndex)
      Returns the substring after last delimiterOfExclusiveBeginIndex if it exists, otherwise return the input str.
      Parameters:
      str -
      delimiterOfExclusiveBeginIndex -
      Returns:
      See Also:
    • substringAfterLastOrElseItself

      @Beta public static String substringAfterLastOrElseItself(String str, String delimiterOfExclusiveBeginIndex)
      Returns the substring after last delimiterOfExclusiveBeginIndex if it exists, otherwise return the input str.
      Parameters:
      str -
      delimiterOfExclusiveBeginIndex -
      Returns:
      See Also:
    • substringAfterLastOrElseItself

      @Beta public static String substringAfterLastOrElseItself(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex)
      Returns the substring after last delimiterOfExclusiveBeginIndex if it exists, otherwise return the input str.
      Parameters:
      str -
      delimiterOfExclusiveBeginIndex -
      exclusiveEndIndex -
      Returns:
      See Also:
    • substringBeforeOrElseItself

      @Beta public static String substringBeforeOrElseItself(String str, char delimiterOfExclusiveEndIndex)
      Returns the substring before first delimiterOfExclusiveBeginIndex if it exists, otherwise return the input str.
      Parameters:
      str -
      delimiterOfExclusiveEndIndex -
      Returns:
      See Also:
    • substringBeforeOrElseItself

      @Beta public static String substringBeforeOrElseItself(String str, String delimiterOfExclusiveEndIndex)
      Returns the substring before first delimiterOfExclusiveBeginIndex if it exists, otherwise return the input str.
      Parameters:
      str -
      delimiterOfExclusiveEndIndex -
      Returns:
      See Also:
    • substringBeforeOrElseItself

      @Beta public static String substringBeforeOrElseItself(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex)
      Returns the substring before first delimiterOfExclusiveBeginIndex if it exists, otherwise return the input str.
      Parameters:
      str -
      inclusiveBeginIndex -
      delimiterOfExclusiveEndIndex -
      Returns:
      See Also:
    • substringBeforeLastOrElseItself

      @Beta public static String substringBeforeLastOrElseItself(String str, char delimiterOfExclusiveEndIndex)
      Returns the substring last first delimiterOfExclusiveBeginIndex if it exists, otherwise return the input str.
      Parameters:
      str -
      delimiterOfExclusiveEndIndex -
      Returns:
      See Also:
    • substringBeforeLastOrElseItself

      @Beta public static String substringBeforeLastOrElseItself(String str, String delimiterOfExclusiveEndIndex)
      Returns the substring last first delimiterOfExclusiveBeginIndex if it exists, otherwise return the input str.
      Parameters:
      str -
      delimiterOfExclusiveEndIndex -
      Returns:
      See Also:
    • substringBeforeLastOrElseItself

      @Beta public static String substringBeforeLastOrElseItself(String str, int exclusiveEndIndex, String delimiterOfExclusiveEndIndex)
      Returns the substring last first delimiterOfExclusiveBeginIndex if it exists, otherwise return the input str.
      Parameters:
      str -
      exclusiveEndIndex -
      delimiterOfExclusiveEndIndex -
      Returns:
      See Also:
    • substringBetween

      public static u.Optional<String> substringBetween(String str, int exclusiveBeginIndex, int exclusiveEndIndex)
      Returns an empty Optional if exclusiveBeginIndex < 0 ||exclusiveEndIndex <= 0 || exclusiveBeginIndex >= exclusiveEndIndex, otherwise an Optional with String value: str.substring(exclusiveBeginIndex + 1, exclusiveEndIndex) is returned.
      Parameters:
      str -
      exclusiveBeginIndex -
      exclusiveEndIndex -
      Returns:
      See Also:
    • substringBetween

      public static u.Optional<String> substringBetween(String str, int exclusiveBeginIndex, char delimiterOfExclusiveEndIndex)
      Parameters:
      str -
      exclusiveBeginIndex -
      delimiterOfExclusiveEndIndex - exclusiveEndIndex <- str.indexOf(delimiterOfExclusiveEndIndex, beginIndex + 1) if exclusiveBeginIndex >= 0
      Returns:
      See Also:
    • substringBetween

      public static u.Optional<String> substringBetween(String str, int exclusiveBeginIndex, String delimiterOfExclusiveEndIndex)
      Parameters:
      str -
      exclusiveBeginIndex -
      delimiterOfExclusiveEndIndex - exclusiveEndIndex <- str.indexOf(delimiterOfExclusiveEndIndex, beginIndex + 1) if exclusiveBeginIndex >= 0
      Returns:
      See Also:
    • substringBetween

      public static u.Optional<String> substringBetween(String str, int exclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex)
      Parameters:
      str -
      exclusiveBeginIndex -
      funcOfExclusiveEndIndex - exclusiveEndIndex <- funcOfExclusiveEndIndex.applyAsInt(inclusiveBeginIndex) if inclusiveBeginIndex >= 0
      Returns:
      See Also:
    • substringBetween

      public static u.Optional<String> substringBetween(String str, char delimiterOfExclusiveBeginIndex, int exclusiveEndIndex)
      Parameters:
      str -
      delimiterOfExclusiveBeginIndex - exclusiveBeginIndex <- str.lastIndexOf(delimiterOfExclusiveBeginIndex, exclusiveEndIndex - 1) if exclusiveEndIndex > 0
      exclusiveEndIndex -
      Returns:
      See Also:
    • substringBetween

      public static u.Optional<String> substringBetween(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex)
      Parameters:
      str -
      delimiterOfExclusiveBeginIndex - exclusiveBeginIndex <- str.lastIndexOf(delimiterOfExclusiveBeginIndex, exclusiveEndIndex - 1) + delimiterOfExclusiveBeginIndex.length() - 1 if exclusiveEndIndex > 0
      exclusiveEndIndex -
      Returns:
      See Also:
    • substringBetween

      public static u.Optional<String> substringBetween(String str, IntUnaryOperator funcOfExclusiveBeginIndex, int exclusiveEndIndex)
      Parameters:
      str -
      funcOfExclusiveBeginIndex - exclusiveBeginIndex <- funcOfExclusiveBeginIndex.applyAsInt(exclusiveEndIndex)) if exclusiveEndIndex > 0
      exclusiveEndIndex -
      Returns:
      See Also:
    • substringBetween

      public static u.Optional<String> substringBetween(String str, char delimiterOfExclusiveBeginIndex, char delimiterOfExclusiveEndIndex)
      Parameters:
      str -
      delimiterOfExclusiveBeginIndex -
      delimiterOfExclusiveEndIndex -
      Returns:
      See Also:
    • substringBetween

      public static u.Optional<String> substringBetween(String str, String tag)
      Parameters:
      str -
      tag -
      Returns:
      See Also:
    • substringBetween

      public static u.Optional<String> substringBetween(String str, String delimiterOfExclusiveBeginIndex, String delimiterOfExclusiveEndIndex)
      Parameters:
      str -
      delimiterOfExclusiveBeginIndex -
      delimiterOfExclusiveEndIndex -
      Returns:
      See Also:
    • substringBetween

      public static u.Optional<String> substringBetween(String str, int fromIndex, String delimiterOfExclusiveBeginIndex, String delimiterOfExclusiveEndIndex)
      Parameters:
      str -
      fromIndex - start index for delimiterOfExclusive. str.indexOf(delimiterOfExclusiveBeginIndex, fromIndex)
      delimiterOfExclusiveBeginIndex -
      delimiterOfExclusiveEndIndex -
      Returns:
      See Also: