Package com.landawn.abacus.util
Class Strings.MoreStringUtil
java.lang.Object
com.landawn.abacus.util.Strings.MoreStringUtil
- Enclosing class:
- Strings
-
Method Summary
Modifier and TypeMethodDescriptionstatic u.Optional<String>
Returns an emptyOptional
ifN.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0
, otherwise anOptional
with String value:str.substring(str.indexOf(delimiterOfInclusiveBeginIndex))
is returned.static u.Optional<String>
static u.Optional<String>
Returns an emptyOptional
ifinclusiveBeginIndex < 0
, otherwise anOptional
with String value:str.substring(inclusiveBeginIndex)
is returned.static u.Optional<String>
static u.Optional<String>
Returns an emptyOptional
ifinclusiveBeginIndex < 0 ||exclusiveEndIndex <= 0 || inclusiveBeginIndex > exclusiveEndIndex
, otherwise anOptional
with String value:str.substring(exclusiveBeginIndex, exclusiveEndIndex)
is returned.static u.Optional<String>
static u.Optional<String>
substring
(String str, int inclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex) static u.Optional<String>
Returns an emptyOptional
ifN.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0
, otherwise anOptional
with String value:str.substring(str.indexOf(delimiterOfInclusiveBeginIndex))
is returned.static u.Optional<String>
static u.Optional<String>
substring
(String str, IntUnaryOperator funcOfInclusiveBeginIndex, int exclusiveEndIndex) static u.Optional<String>
substringAfter
(String str, char delimiterOfExclusiveBeginIndex) Returns the substring after firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.static u.Optional<String>
substringAfter
(String str, String delimiterOfExclusiveBeginIndex) Returns the substring after firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.static u.Optional<String>
substringAfter
(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) Returns the substring after firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.static u.Optional<String>
substringAfterAny
(String str, char... delimitersOfExclusiveBeginIndex) Returns the substring after any ofdelimitersOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.static u.Optional<String>
substringAfterAny
(String str, String... delimitersOfExclusiveBeginIndex) Returns the substring after any ofdelimitersOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.static u.Optional<String>
substringAfterLast
(String str, char delimiterOfExclusiveBeginIndex) Returns the substring after lastdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.static u.Optional<String>
substringAfterLast
(String str, String delimiterOfExclusiveBeginIndex) Returns the substring after lastdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.static u.Optional<String>
substringAfterLast
(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) Returns the substring after lastdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.static String
substringAfterLastOrElse
(String str, String delimiterOfExclusiveBeginIndex, String defaultStr) Returns the substring after lastdelimiterOfExclusiveBeginIndex
if it exists, otherwise returndefaultStr
.static String
substringAfterLastOrElseItself
(String str, char delimiterOfExclusiveBeginIndex) Returns the substring after lastdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.static String
substringAfterLastOrElseItself
(String str, String delimiterOfExclusiveBeginIndex) Returns the substring after lastdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.static String
substringAfterLastOrElseItself
(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) Returns the substring after lastdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.static String
substringAfterOrElse
(String str, String delimiterOfExclusiveBeginIndex, String defaultStr) Returns the substring after firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returndefaultStr
.static String
substringAfterOrElseItself
(String str, char delimiterOfExclusiveBeginIndex) Returns the substring after firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.static String
substringAfterOrElseItself
(String str, String delimiterOfExclusiveBeginIndex) Returns the substring after firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.static String
substringAfterOrElseItself
(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) Returns the substring after firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.static u.Optional<String>
substringBefore
(String str, char delimiterOfExclusiveEndIndex) Returns the substring before firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.static u.Optional<String>
substringBefore
(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex) Returns the substring before firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.static u.Optional<String>
substringBefore
(String str, String delimiterOfExclusiveEndIndex) Returns the substring before firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.static u.Optional<String>
substringBeforeAny
(String str, char... delimitersOfExclusiveEndIndex) Returns the substring before any ofdelimitersOfExclusiveEndIndex
if it exists, otherwise returnnull
String.static u.Optional<String>
substringBeforeAny
(String str, String... delimitersOfExclusiveEndIndex) Returns the substring before any ofdelimitersOfExclusiveEndIndex
if it exists, otherwise returnnull
String.static u.Optional<String>
substringBeforeLast
(String str, char delimiterOfExclusiveEndIndex) Returns the substring last firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.static u.Optional<String>
substringBeforeLast
(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex) Returns the substring last firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.static u.Optional<String>
substringBeforeLast
(String str, String delimiterOfExclusiveEndIndex) Returns the substring last firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.static String
substringBeforeLastOrElse
(String str, String delimiterOfExclusiveEndIndex, String defaultStr) Returns the substring last firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returndefaultStr
.static String
substringBeforeLastOrElseItself
(String str, char delimiterOfExclusiveEndIndex) Returns the substring last firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.static String
substringBeforeLastOrElseItself
(String str, int exclusiveEndIndex, String delimiterOfExclusiveEndIndex) Returns the substring last firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.static String
substringBeforeLastOrElseItself
(String str, String delimiterOfExclusiveEndIndex) Returns the substring last firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.static String
substringBeforeOrElse
(String str, String delimiterOfExclusiveEndIndex, String defaultStr) Returns the substring before firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returndefaultStr
.static String
substringBeforeOrElseItself
(String str, char delimiterOfExclusiveEndIndex) Returns the substring before firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.static String
substringBeforeOrElseItself
(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex) Returns the substring before firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.static String
substringBeforeOrElseItself
(String str, String delimiterOfExclusiveEndIndex) Returns the substring before firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.static u.Optional<String>
substringBetween
(String str, char delimiterOfExclusiveBeginIndex, char delimiterOfExclusiveEndIndex) static u.Optional<String>
substringBetween
(String str, char delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) static u.Optional<String>
substringBetween
(String str, int exclusiveBeginIndex, char delimiterOfExclusiveEndIndex) static u.Optional<String>
substringBetween
(String str, int exclusiveBeginIndex, int exclusiveEndIndex) Returns an emptyOptional
ifexclusiveBeginIndex < 0 ||exclusiveEndIndex <= 0 || exclusiveBeginIndex >= exclusiveEndIndex
, otherwise anOptional
with String value:str.substring(exclusiveBeginIndex + 1, exclusiveEndIndex)
is returned.static u.Optional<String>
substringBetween
(String str, int exclusiveBeginIndex, String delimiterOfExclusiveEndIndex) static u.Optional<String>
substringBetween
(String str, int fromIndex, String delimiterOfExclusiveBeginIndex, String delimiterOfExclusiveEndIndex) static u.Optional<String>
substringBetween
(String str, int exclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex) static u.Optional<String>
substringBetween
(String str, String tag) static u.Optional<String>
substringBetween
(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) static u.Optional<String>
substringBetween
(String str, String delimiterOfExclusiveBeginIndex, String delimiterOfExclusiveEndIndex) static u.Optional<String>
substringBetween
(String str, IntUnaryOperator funcOfExclusiveBeginIndex, int exclusiveEndIndex) static String
substringOrElse
(String str, char delimiterOfInclusiveBeginIndex, int exclusiveEndIndex, String defaultStr) static String
substringOrElse
(String str, char delimiterOfInclusiveBeginIndex, String defaultStr) ReturnsdefaultStr
ifN.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0
, otherwise anOptional
with String value:str.substring(str.indexOf(delimiterOfInclusiveBeginIndex))
is returned.static String
substringOrElse
(String str, int inclusiveBeginIndex, char delimiterOfExclusiveEndIndex, String defaultStr) static String
substringOrElse
(String str, int inclusiveBeginIndex, int exclusiveEndIndex, String defaultStr) ReturnsdefaultStr
ifinclusiveBeginIndex < 0 ||exclusiveEndIndex <= 0 || inclusiveBeginIndex > exclusiveEndIndex
, otherwise anOptional
with String value:str.substring(exclusiveBeginIndex, exclusiveEndIndex)
is returned.static String
substringOrElse
(String str, int inclusiveBeginIndex, String defaultStr) ReturnsdefaultStr
ifinclusiveBeginIndex < 0
, otherwise anOptional
with String value:str.substring(inclusiveBeginIndex)
is returned.static String
substringOrElse
(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex, String defaultStr) static String
substringOrElse
(String str, int inclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex, String defaultStr) static String
substringOrElse
(String str, String delimiterOfInclusiveBeginIndex, int exclusiveEndIndex, String defaultStr) static String
substringOrElse
(String str, String delimiterOfInclusiveBeginIndex, String defaultStr) ReturnsdefaultStr
ifN.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0
, otherwise anOptional
with String value:str.substring(str.indexOf(delimiterOfInclusiveBeginIndex))
is returned.static String
substringOrElse
(String str, IntUnaryOperator funcOfInclusiveBeginIndex, int exclusiveEndIndex, String defaultStr) static String
substringOrElseItself
(String str, char delimiterOfInclusiveBeginIndex) Returns the inputstr
ifN.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0
, otherwise anOptional
with String value:str.substring(str.indexOf(delimiterOfInclusiveBeginIndex))
is returned.static String
substringOrElseItself
(String str, char delimiterOfInclusiveBeginIndex, int exclusiveEndIndex) static String
substringOrElseItself
(String str, int inclusiveBeginIndex) Returns the inputstr
ifinclusiveBeginIndex < 0
, otherwise anOptional
with String value:str.substring(inclusiveBeginIndex)
is returned.static String
substringOrElseItself
(String str, int inclusiveBeginIndex, char delimiterOfExclusiveEndIndex) static String
substringOrElseItself
(String str, int inclusiveBeginIndex, int exclusiveEndIndex) Returns the inputstr
ifinclusiveBeginIndex < 0 ||exclusiveEndIndex <= 0 || inclusiveBeginIndex > exclusiveEndIndex
, otherwise anOptional
with String value:str.substring(exclusiveBeginIndex, exclusiveEndIndex)
is returned.static String
substringOrElseItself
(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex) static String
substringOrElseItself
(String str, int inclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex) static String
substringOrElseItself
(String str, String delimiterOfInclusiveBeginIndex) Returns the inputstr
ifN.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0
, otherwise anOptional
with String value:str.substring(str.indexOf(delimiterOfInclusiveBeginIndex))
is returned.static String
substringOrElseItself
(String str, String delimiterOfInclusiveBeginIndex, int exclusiveEndIndex) static String
substringOrElseItself
(String str, IntUnaryOperator funcOfInclusiveBeginIndex, int exclusiveEndIndex)
-
Method Details
-
substring
Returns an emptyOptional
ifinclusiveBeginIndex < 0
, otherwise anOptional
with String value:str.substring(inclusiveBeginIndex)
is returned.- Parameters:
str
-inclusiveBeginIndex
-- Returns:
- See Also:
-
substring
Returns an emptyOptional
ifN.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0
, otherwise anOptional
with String value:str.substring(str.indexOf(delimiterOfInclusiveBeginIndex))
is returned.- Parameters:
str
-delimiterOfInclusiveBeginIndex
-inclusiveBeginIndex <- str.indexOf(delimiterOfInclusiveBeginIndex)
- Returns:
- See Also:
-
substring
Returns an emptyOptional
ifN.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0
, otherwise anOptional
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 emptyOptional
ifinclusiveBeginIndex < 0 ||exclusiveEndIndex <= 0 || inclusiveBeginIndex > exclusiveEndIndex
, otherwise anOptional
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
ReturnsdefaultStr
ifinclusiveBeginIndex < 0
, otherwise anOptional
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) ReturnsdefaultStr
ifN.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0
, otherwise anOptional
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) ReturnsdefaultStr
ifN.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0
, otherwise anOptional
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) ReturnsdefaultStr
ifinclusiveBeginIndex < 0 ||exclusiveEndIndex <= 0 || inclusiveBeginIndex > exclusiveEndIndex
, otherwise anOptional
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
Returns the inputstr
ifinclusiveBeginIndex < 0
, otherwise anOptional
with String value:str.substring(inclusiveBeginIndex)
is returned.- Parameters:
str
-inclusiveBeginIndex
-- Returns:
- See Also:
-
substringOrElseItself
Returns the inputstr
ifN.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0
, otherwise anOptional
with String value:str.substring(str.indexOf(delimiterOfInclusiveBeginIndex))
is returned.- Parameters:
str
-delimiterOfInclusiveBeginIndex
-inclusiveBeginIndex <- str.indexOf(delimiterOfInclusiveBeginIndex)
- Returns:
- See Also:
-
substringOrElseItself
Returns the inputstr
ifN.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0
, otherwise anOptional
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 inputstr
ifinclusiveBeginIndex < 0 ||exclusiveEndIndex <= 0 || inclusiveBeginIndex > exclusiveEndIndex
, otherwise anOptional
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 firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringAfter
@Beta public static u.Optional<String> substringAfter(String str, String delimiterOfExclusiveBeginIndex) Returns the substring after firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
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 firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-exclusiveEndIndex
-- Returns:
- See Also:
-
substringAfterLast
@Beta public static u.Optional<String> substringAfterLast(String str, char delimiterOfExclusiveBeginIndex) Returns the substring after lastdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringAfterLast
@Beta public static u.Optional<String> substringAfterLast(String str, String delimiterOfExclusiveBeginIndex) Returns the substring after lastdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
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 lastdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
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 ofdelimitersOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.- Parameters:
str
-delimitersOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringAfterAny
@Beta public static u.Optional<String> substringAfterAny(String str, String... delimitersOfExclusiveBeginIndex) Returns the substring after any ofdelimitersOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.- Parameters:
str
-delimitersOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringBefore
@Beta public static u.Optional<String> substringBefore(String str, char delimiterOfExclusiveEndIndex) Returns the substring before firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.- Parameters:
str
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBefore
@Beta public static u.Optional<String> substringBefore(String str, String delimiterOfExclusiveEndIndex) Returns the substring before firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
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 firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.- Parameters:
str
-inclusiveBeginIndex
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeLast
@Beta public static u.Optional<String> substringBeforeLast(String str, char delimiterOfExclusiveEndIndex) Returns the substring last firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.- Parameters:
str
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeLast
@Beta public static u.Optional<String> substringBeforeLast(String str, String delimiterOfExclusiveEndIndex) Returns the substring last firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
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 firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
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 ofdelimitersOfExclusiveEndIndex
if it exists, otherwise returnnull
String.- Parameters:
str
-delimitersOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeAny
@Beta public static u.Optional<String> substringBeforeAny(String str, String... delimitersOfExclusiveEndIndex) Returns the substring before any ofdelimitersOfExclusiveEndIndex
if it exists, otherwise returnnull
String.- Parameters:
str
-delimitersOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringAfterOrElse
@Beta public static String substringAfterOrElse(String str, String delimiterOfExclusiveBeginIndex, String defaultStr) Returns the substring after firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returndefaultStr
.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-defaultStr
-- Returns:
- See Also:
-
substringAfterLastOrElse
@Beta public static String substringAfterLastOrElse(String str, String delimiterOfExclusiveBeginIndex, String defaultStr) Returns the substring after lastdelimiterOfExclusiveBeginIndex
if it exists, otherwise returndefaultStr
.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-defaultStr
-- Returns:
- See Also:
-
substringBeforeOrElse
@Beta public static String substringBeforeOrElse(String str, String delimiterOfExclusiveEndIndex, String defaultStr) Returns the substring before firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returndefaultStr
.- Parameters:
str
-delimiterOfExclusiveEndIndex
-defaultStr
-- Returns:
- See Also:
-
substringBeforeLastOrElse
@Beta public static String substringBeforeLastOrElse(String str, String delimiterOfExclusiveEndIndex, String defaultStr) Returns the substring last firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returndefaultStr
.- Parameters:
str
-delimiterOfExclusiveEndIndex
-defaultStr
-- Returns:
- See Also:
-
substringAfterOrElseItself
@Beta public static String substringAfterOrElseItself(String str, char delimiterOfExclusiveBeginIndex) Returns the substring after firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringAfterOrElseItself
@Beta public static String substringAfterOrElseItself(String str, String delimiterOfExclusiveBeginIndex) Returns the substring after firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringAfterOrElseItself
@Beta public static String substringAfterOrElseItself(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) Returns the substring after firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-exclusiveEndIndex
-- Returns:
- See Also:
-
substringAfterLastOrElseItself
@Beta public static String substringAfterLastOrElseItself(String str, char delimiterOfExclusiveBeginIndex) Returns the substring after lastdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringAfterLastOrElseItself
@Beta public static String substringAfterLastOrElseItself(String str, String delimiterOfExclusiveBeginIndex) Returns the substring after lastdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringAfterLastOrElseItself
@Beta public static String substringAfterLastOrElseItself(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex) Returns the substring after lastdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-exclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeOrElseItself
@Beta public static String substringBeforeOrElseItself(String str, char delimiterOfExclusiveEndIndex) Returns the substring before firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.- Parameters:
str
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeOrElseItself
@Beta public static String substringBeforeOrElseItself(String str, String delimiterOfExclusiveEndIndex) Returns the substring before firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.- Parameters:
str
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeOrElseItself
@Beta public static String substringBeforeOrElseItself(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex) Returns the substring before firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.- Parameters:
str
-inclusiveBeginIndex
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeLastOrElseItself
@Beta public static String substringBeforeLastOrElseItself(String str, char delimiterOfExclusiveEndIndex) Returns the substring last firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.- Parameters:
str
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeLastOrElseItself
@Beta public static String substringBeforeLastOrElseItself(String str, String delimiterOfExclusiveEndIndex) Returns the substring last firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.- Parameters:
str
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeLastOrElseItself
@Beta public static String substringBeforeLastOrElseItself(String str, int exclusiveEndIndex, String delimiterOfExclusiveEndIndex) Returns the substring last firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.- Parameters:
str
-exclusiveEndIndex
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBetween
public static u.Optional<String> substringBetween(String str, int exclusiveBeginIndex, int exclusiveEndIndex) Returns an emptyOptional
ifexclusiveBeginIndex < 0 ||exclusiveEndIndex <= 0 || exclusiveBeginIndex >= exclusiveEndIndex
, otherwise anOptional
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
- 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 fordelimiterOfExclusive
.str.indexOf(delimiterOfExclusiveBeginIndex, fromIndex)
delimiterOfExclusiveBeginIndex
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-