Package com.landawn.abacus.util
Class Strings.StrUtil
java.lang.Object
com.landawn.abacus.util.Strings.StrUtil
- Enclosing class:
- Strings
-
Method Summary
Modifier and TypeMethodDescriptionstatic u.Optional<BigDecimal>
createBigDecimal
(String str) Returns an emptyOptional<BigDecimal>
if the specified string is blank or a invalidBigDecimal
string.static u.Optional<BigInteger>
createBigInteger
(String str) Returns an emptyOptional<BigInteger>
if the specified string is blank or a invalidBigInteger
string.static u.OptionalDouble
createDouble
(String str) Returns an emptyOptionalDouble
if the specified string is blank or a invalid double string.static u.OptionalFloat
createFloat
(String str) Returns an emptyOptionalFloat
if the specified string is blank or a invalid float string.static u.OptionalInt
createInteger
(String str) Returns an emptyOptionalInt
if the specified string is blank or a invalid integer string.static u.OptionalLong
createLong
(String str) Returns an emptyOptionalLong
if the specified string is blank or a invalid long string.static u.Optional<Number>
createNumber
(String str) Returns an emptyOptional<Number>
if the specified string is blank or a invalid number string.static <T extends CharSequence>
u.Optional<T>firstNonBlank
(T... a) static <T extends CharSequence>
u.Optional<T>firstNonBlank
(T a, T b) static <T extends CharSequence>
u.Optional<T>firstNonBlank
(T a, T b, T c) static <T extends CharSequence>
u.Optional<T>firstNonEmpty
(T... a) static <T extends CharSequence>
u.Optional<T>firstNonEmpty
(T a, T b) static <T extends CharSequence>
u.Optional<T>firstNonEmpty
(T a, T b, T c) static u.Optional<String>
ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substring
(String str, int inclusiveBeginIndex, BiFunction<String, Integer, Integer> funcOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substring
(String str, int inclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substring
(String str, BiFunction<String, Integer, Integer> funcOfInclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substring
(String str, IntUnaryOperator funcOfInclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringAfter
(String str, char delimiterOfExclusiveBeginIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringAfter
(String str, String delimiterOfExclusiveBeginIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringAfter
(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringAfterAny
(String str, char... delimitersOfExclusiveBeginIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringAfterAny
(String str, String... delimitersOfExclusiveBeginIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringAfterLast
(String str, char delimiterOfExclusiveBeginIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringAfterLast
(String str, String delimiterOfExclusiveBeginIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringAfterLast
(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static String
substringAfterLastOrElse
(String str, String delimiterOfExclusiveBeginIndex, String defaultStr) Returns the substring if it exists, otherwise returnsdefaultStr
.static String
substringAfterLastOrElseItself
(String str, char delimiterOfExclusiveBeginIndex) Returns the substring if it exists, otherwise returnsstr
itself.static String
substringAfterLastOrElseItself
(String str, String delimiterOfExclusiveBeginIndex) Returns the substring if it exists, otherwise returnsstr
itself.static String
substringAfterLastOrElseItself
(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.static String
substringAfterOrElse
(String str, String delimiterOfExclusiveBeginIndex, String defaultStr) Returns the substring if it exists, otherwise returnsdefaultStr
.static String
substringAfterOrElseItself
(String str, char delimiterOfExclusiveBeginIndex) Returns the substring if it exists, otherwise returnsstr
itself.static String
substringAfterOrElseItself
(String str, String delimiterOfExclusiveBeginIndex) Returns the substring if it exists, otherwise returnsstr
itself.static String
substringAfterOrElseItself
(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.static u.Optional<String>
substringBefore
(String str, char delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBefore
(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBefore
(String str, String delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBeforeAny
(String str, char... delimitersOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBeforeAny
(String str, String... delimitersOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBeforeLast
(String str, char delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBeforeLast
(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBeforeLast
(String str, String delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static String
substringBeforeLastOrElse
(String str, String delimiterOfExclusiveEndIndex, String defaultStr) Returns the substring if it exists, otherwise returnsdefaultStr
.static String
substringBeforeLastOrElseItself
(String str, char delimiterOfExclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.static String
substringBeforeLastOrElseItself
(String str, int exclusiveEndIndex, String delimiterOfExclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.static String
substringBeforeLastOrElseItself
(String str, String delimiterOfExclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.static String
substringBeforeOrElse
(String str, String delimiterOfExclusiveEndIndex, String defaultStr) Returns the substring if it exists, otherwise returnsdefaultStr
.static String
substringBeforeOrElseItself
(String str, char delimiterOfExclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.static String
substringBeforeOrElseItself
(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.static String
substringBeforeOrElseItself
(String str, String delimiterOfExclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.static u.Optional<String>
substringBetween
(String str, char delimiterOfExclusiveBeginIndex, char delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBetween
(String str, char delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBetween
(String str, int exclusiveBeginIndex, char delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBetween
(String str, int exclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBetween
(String str, int exclusiveBeginIndex, String delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBetween
(String str, int fromIndex, String delimiterOfExclusiveBeginIndex, String delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBetween
(String str, int exclusiveBeginIndex, BiFunction<String, Integer, Integer> funcOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBetween
(String str, int exclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBetween
(String str, String tag) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBetween
(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBetween
(String str, String delimiterOfExclusiveBeginIndex, String delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBetween
(String str, String delimiterOfExclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBetween
(String str, BiFunction<String, Integer, Integer> funcOfExclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBetween
(String str, IntUnaryOperator funcOfExclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
static u.Optional<String>
substringBetween
(String str, IntUnaryOperator funcOfExclusiveBeginIndex, String delimiterOfExclusiveEndIndex) static String
substringOrElse
(String str, int inclusiveBeginIndex, int exclusiveEndIndex, String defaultStr) Returns the substring if it exists, otherwise returnsdefaultStr
.static String
substringOrElse
(String str, int inclusiveBeginIndex, String defaultStr) Returns the substring if it exists, otherwise returnsdefaultStr
.static String
substringOrElse
(String str, int inclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex, String defaultStr) Returns the substring if it exists, otherwise returnsdefaultStr
.static String
substringOrElse
(String str, IntUnaryOperator funcOfInclusiveBeginIndex, int exclusiveEndIndex, String defaultStr) Returns the substring if it exists, otherwise returnsdefaultStr
.static String
substringOrElseItself
(String str, int inclusiveBeginIndex) Returns the substring if it exists, otherwise returnsstr
itself.static String
substringOrElseItself
(String str, int inclusiveBeginIndex, int exclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.static String
substringOrElseItself
(String str, int inclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.static String
substringOrElseItself
(String str, IntUnaryOperator funcOfInclusiveBeginIndex, int exclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.
-
Method Details
-
substring
ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-inclusiveBeginIndex
-- Returns:
- See Also:
-
substring
public static u.Optional<String> substring(String str, int inclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-inclusiveBeginIndex
-exclusiveEndIndex
-- Returns:
- See Also:
-
substring
public static u.Optional<String> substring(String str, int inclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-inclusiveBeginIndex
-funcOfExclusiveEndIndex
-- Returns:
- See Also:
-
substring
@Beta public static u.Optional<String> substring(String str, int inclusiveBeginIndex, BiFunction<String, Integer, Integer> funcOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-inclusiveBeginIndex
-funcOfExclusiveEndIndex
-- Returns:
- See Also:
-
substring
public static u.Optional<String> substring(String str, IntUnaryOperator funcOfInclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-funcOfInclusiveBeginIndex
-exclusiveEndIndex
-- Returns:
- See Also:
-
substring
@Beta public static u.Optional<String> substring(String str, BiFunction<String, Integer, Integer> funcOfInclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-funcOfInclusiveBeginIndex
-exclusiveEndIndex
-- Returns:
- See Also:
-
substringOrElse
Returns the substring if it exists, otherwise returnsdefaultStr
.- Parameters:
str
-inclusiveBeginIndex
-defaultStr
-- Returns:
- See Also:
-
substringOrElse
@Beta public static String substringOrElse(String str, int inclusiveBeginIndex, int exclusiveEndIndex, String defaultStr) Returns the substring if it exists, otherwise returnsdefaultStr
.- Parameters:
str
-inclusiveBeginIndex
-exclusiveEndIndex
-defaultStr
-- Returns:
- See Also:
-
substringOrElse
@Beta public static String substringOrElse(String str, int inclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex, String defaultStr) Returns the substring if it exists, otherwise returnsdefaultStr
.- Parameters:
str
-inclusiveBeginIndex
-funcOfExclusiveEndIndex
-defaultStr
-- Returns:
- See Also:
-
substringOrElse
@Beta public static String substringOrElse(String str, IntUnaryOperator funcOfInclusiveBeginIndex, int exclusiveEndIndex, String defaultStr) Returns the substring if it exists, otherwise returnsdefaultStr
.- Parameters:
str
-funcOfInclusiveBeginIndex
-exclusiveEndIndex
-defaultStr
-- Returns:
- See Also:
-
substringOrElseItself
Returns the substring if it exists, otherwise returnsstr
itself.- Parameters:
str
-inclusiveBeginIndex
-- Returns:
- See Also:
-
substringOrElseItself
@Beta public static String substringOrElseItself(String str, int inclusiveBeginIndex, int exclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.- Parameters:
str
-inclusiveBeginIndex
-exclusiveEndIndex
-- Returns:
- See Also:
-
substringOrElseItself
@Beta public static String substringOrElseItself(String str, int inclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.- Parameters:
str
-inclusiveBeginIndex
-funcOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringOrElseItself
@Beta public static String substringOrElseItself(String str, IntUnaryOperator funcOfInclusiveBeginIndex, int exclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.- Parameters:
str
-funcOfInclusiveBeginIndex
-exclusiveEndIndex
-- Returns:
- See Also:
-
substringAfter
@Beta public static u.Optional<String> substringAfter(String str, char delimiterOfExclusiveBeginIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimiterOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringAfter
@Beta public static u.Optional<String> substringAfter(String str, String delimiterOfExclusiveBeginIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimiterOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringAfter
@Beta public static u.Optional<String> substringAfter(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimiterOfExclusiveBeginIndex
-exclusiveEndIndex
-- Returns:
- See Also:
-
substringAfterLast
@Beta public static u.Optional<String> substringAfterLast(String str, char delimiterOfExclusiveBeginIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimiterOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringAfterLast
@Beta public static u.Optional<String> substringAfterLast(String str, String delimiterOfExclusiveBeginIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimiterOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringAfterLast
@Beta public static u.Optional<String> substringAfterLast(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimiterOfExclusiveBeginIndex
-exclusiveEndIndex
-- Returns:
- See Also:
-
substringAfterAny
@Beta public static u.Optional<String> substringAfterAny(String str, char... delimitersOfExclusiveBeginIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimitersOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringAfterAny
@Beta public static u.Optional<String> substringAfterAny(String str, String... delimitersOfExclusiveBeginIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimitersOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringBefore
@Beta public static u.Optional<String> substringBefore(String str, char delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBefore
@Beta public static u.Optional<String> substringBefore(String str, String delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBefore
@Beta public static u.Optional<String> substringBefore(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-inclusiveBeginIndex
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeLast
@Beta public static u.Optional<String> substringBeforeLast(String str, char delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeLast
@Beta public static u.Optional<String> substringBeforeLast(String str, String delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeLast
@Beta public static u.Optional<String> substringBeforeLast(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-inclusiveBeginIndex
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeAny
@Beta public static u.Optional<String> substringBeforeAny(String str, char... delimitersOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimitersOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeAny
@Beta public static u.Optional<String> substringBeforeAny(String str, String... delimitersOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimitersOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringAfterOrElse
@Beta public static String substringAfterOrElse(String str, String delimiterOfExclusiveBeginIndex, String defaultStr) Returns the substring if it exists, otherwise returnsdefaultStr
.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-defaultStr
-- Returns:
- See Also:
-
substringAfterLastOrElse
@Beta public static String substringAfterLastOrElse(String str, String delimiterOfExclusiveBeginIndex, String defaultStr) Returns the substring if it exists, otherwise returnsdefaultStr
.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-defaultStr
-- Returns:
- See Also:
-
substringBeforeOrElse
@Beta public static String substringBeforeOrElse(String str, String delimiterOfExclusiveEndIndex, String defaultStr) Returns the substring if it exists, otherwise returnsdefaultStr
.- Parameters:
str
-delimiterOfExclusiveEndIndex
-defaultStr
-- Returns:
- See Also:
-
substringBeforeLastOrElse
@Beta public static String substringBeforeLastOrElse(String str, String delimiterOfExclusiveEndIndex, String defaultStr) Returns the substring if it exists, otherwise returnsdefaultStr
.- Parameters:
str
-delimiterOfExclusiveEndIndex
-defaultStr
-- Returns:
- See Also:
-
substringAfterOrElseItself
@Beta public static String substringAfterOrElseItself(String str, char delimiterOfExclusiveBeginIndex) Returns the substring if it exists, otherwise returnsstr
itself.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringAfterOrElseItself
@Beta public static String substringAfterOrElseItself(String str, String delimiterOfExclusiveBeginIndex) Returns the substring if it exists, otherwise returnsstr
itself.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringAfterOrElseItself
@Beta public static String substringAfterOrElseItself(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-exclusiveEndIndex
-- Returns:
- See Also:
-
substringAfterLastOrElseItself
@Beta public static String substringAfterLastOrElseItself(String str, char delimiterOfExclusiveBeginIndex) Returns the substring if it exists, otherwise returnsstr
itself.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringAfterLastOrElseItself
@Beta public static String substringAfterLastOrElseItself(String str, String delimiterOfExclusiveBeginIndex) Returns the substring if it exists, otherwise returnsstr
itself.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringAfterLastOrElseItself
@Beta public static String substringAfterLastOrElseItself(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-exclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeOrElseItself
@Beta public static String substringBeforeOrElseItself(String str, char delimiterOfExclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.- Parameters:
str
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeOrElseItself
@Beta public static String substringBeforeOrElseItself(String str, String delimiterOfExclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.- Parameters:
str
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeOrElseItself
@Beta public static String substringBeforeOrElseItself(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.- Parameters:
str
-inclusiveBeginIndex
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeLastOrElseItself
@Beta public static String substringBeforeLastOrElseItself(String str, char delimiterOfExclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.- Parameters:
str
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeLastOrElseItself
@Beta public static String substringBeforeLastOrElseItself(String str, String delimiterOfExclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.- Parameters:
str
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeLastOrElseItself
@Beta public static String substringBeforeLastOrElseItself(String str, int exclusiveEndIndex, String delimiterOfExclusiveEndIndex) Returns the substring if it exists, otherwise returnsstr
itself.- Parameters:
str
-exclusiveEndIndex
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBetween
public static u.Optional<String> substringBetween(String str, int exclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-exclusiveBeginIndex
-exclusiveEndIndex
-- Returns:
- See Also:
-
substringBetween
public static u.Optional<String> substringBetween(String str, int exclusiveBeginIndex, char delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-exclusiveBeginIndex
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBetween
public static u.Optional<String> substringBetween(String str, int exclusiveBeginIndex, String delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-exclusiveBeginIndex
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBetween
public static u.Optional<String> substringBetween(String str, char delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimiterOfExclusiveBeginIndex
-exclusiveEndIndex
-- Returns:
- See Also:
-
substringBetween
public static u.Optional<String> substringBetween(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimiterOfExclusiveBeginIndex
-exclusiveEndIndex
-- Returns:
- See Also:
-
substringBetween
public static u.Optional<String> substringBetween(String str, char delimiterOfExclusiveBeginIndex, char delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimiterOfExclusiveBeginIndex
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBetween
ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-tag
-- Returns:
- See Also:
-
substringBetween
public static u.Optional<String> substringBetween(String str, String delimiterOfExclusiveBeginIndex, String delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimiterOfExclusiveBeginIndex
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBetween
public static u.Optional<String> substringBetween(String str, int fromIndex, String delimiterOfExclusiveBeginIndex, String delimiterOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-fromIndex
-delimiterOfExclusiveBeginIndex
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBetween
public static u.Optional<String> substringBetween(String str, int exclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-exclusiveBeginIndex
-funcOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBetween
@Beta public static u.Optional<String> substringBetween(String str, int exclusiveBeginIndex, BiFunction<String, Integer, Integer> funcOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-exclusiveBeginIndex
-funcOfExclusiveEndIndex
-exclusiveEndIndex <- funcOfExclusiveEndIndex.apply(str, exclusiveBeginIndex) if inclusiveBeginIndex >= 0
- Returns:
- See Also:
-
substringBetween
public static u.Optional<String> substringBetween(String str, IntUnaryOperator funcOfExclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-funcOfExclusiveBeginIndex
-exclusiveEndIndex
-- Returns:
- See Also:
-
substringBetween
@Beta public static u.Optional<String> substringBetween(String str, BiFunction<String, Integer, Integer> funcOfExclusiveBeginIndex, int exclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-funcOfExclusiveBeginIndex
-exclusiveBeginIndex <- funcOfExclusiveBeginIndex.apply(str, exclusiveEndIndex)) if exclusiveEndIndex >= 0
exclusiveEndIndex
-- Returns:
- See Also:
-
substringBetween
public static u.Optional<String> substringBetween(String str, String delimiterOfExclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex) ReturnsOptional<String>
with value of the substring if it exists, otherwise returns an emptyOptional<String>
- Parameters:
str
-delimiterOfExclusiveBeginIndex
-funcOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBetween
public static u.Optional<String> substringBetween(String str, IntUnaryOperator funcOfExclusiveBeginIndex, String delimiterOfExclusiveEndIndex) - Parameters:
str
-funcOfExclusiveBeginIndex
- (exclusiveBeginIndex <- funcOfExclusiveBeginIndex.applyAsInt(exclusiveEndIndex))delimiterOfExclusiveEndIndex
- (exclusiveEndIndex <- str.lastIndexOf(delimiterOfExclusiveEndIndex))- Returns:
- See Also:
-
firstNonEmpty
- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
-
firstNonEmpty
- Type Parameters:
T
-- Parameters:
a
-b
-c
-- Returns:
-
firstNonEmpty
- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
firstNonBlank
- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
-
firstNonBlank
- Type Parameters:
T
-- Parameters:
a
-b
-c
-- Returns:
-
firstNonBlank
- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
createInteger
Returns an emptyOptionalInt
if the specified string is blank or a invalid integer string. Otherwise returnsOptionalInt
with value converted from the specified String.- Parameters:
str
-- Returns:
- See Also:
-
createLong
Returns an emptyOptionalLong
if the specified string is blank or a invalid long string. Otherwise returnsOptionalLong
with value converted from the specified String.- Parameters:
str
-- Returns:
- See Also:
-
createFloat
Returns an emptyOptionalFloat
if the specified string is blank or a invalid float string. Otherwise returnsOptionalFloat
with value converted from the specified String.- Parameters:
str
-- Returns:
- See Also:
-
createDouble
Returns an emptyOptionalDouble
if the specified string is blank or a invalid double string. Otherwise returnsOptionalDouble
with value converted from the specified String.- Parameters:
str
-- Returns:
- See Also:
-
createBigInteger
Returns an emptyOptional<BigInteger>
if the specified string is blank or a invalidBigInteger
string. Otherwise returnsOptional<BigInteger>
with value converted from the specified String.- Parameters:
str
-- Returns:
- See Also:
-
createBigDecimal
Returns an emptyOptional<BigDecimal>
if the specified string is blank or a invalidBigDecimal
string. Otherwise returnsOptional<BigDecimal>
with value converted from the specified String.- Parameters:
str
-- Returns:
- See Also:
-
createNumber
Returns an emptyOptional<Number>
if the specified string is blank or a invalid number string. Otherwise returnsOptional<Number>
with value converted from the specified String.- Parameters:
str
-- Returns:
- See Also:
-