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 String[]
copyThenStrip
(String[] strs) static String[]
copyThenTrim
(String[] strs) 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>
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, String delimiterOfExclusiveBeginIndex) Returns the substring after firstdelimiterOfExclusiveBeginIndex
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 String
substringAfterLastOrElse
(String str, String delimiterOfExclusiveBeginIndex, String defaultStr) Returns the substring after lastdelimiterOfExclusiveBeginIndex
if it exists, otherwise returndefaultStr
.static String
substringAfterLastOrElseItself
(String str, String delimiterOfExclusiveBeginIndex) 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, String delimiterOfExclusiveBeginIndex) Returns the substring after firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise return the inputstr
.static u.Optional<String>
substringBefore
(String str, String delimiterOfExclusiveEndIndex) Returns the substring before 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, 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, 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
-defaultStr
-- 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)
defaultStr
-- 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)
defaultStr
-- 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
-defaultStr
-- 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
defaultStr
-- 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
defaultStr
-- 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
defaultStr
-- 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
-defaultStr
-- 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
-defaultStr
-- 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
-defaultStr
-- Returns:
- See Also:
-
substringAfter
Returns the substring after firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.- Parameters:
str
-delimiterOfExclusiveBeginIndex
-- Returns:
- See Also:
-
substringAfterLast
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:
-
substringBefore
Returns the substring before firstdelimiterOfExclusiveBeginIndex
if it exists, otherwise returnnull
String.- Parameters:
str
-delimiterOfExclusiveEndIndex
-- Returns:
- See Also:
-
substringBeforeLast
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:
-
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, String delimiterOfExclusiveBeginIndex) Returns the substring after firstdelimiterOfExclusiveBeginIndex
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:
-
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:
-
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:
-
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
-delimiterOfExclusiveBeginIndex
-- 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
-delimiterOfExclusiveBeginIndex
-- 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
-delimiterOfExclusiveBeginIndex
-- Returns:
- See Also:
-
copyThenTrim
- Parameters:
strs
-- Returns:
- See Also:
-
copyThenStrip
- Parameters:
strs
-- Returns:
- See Also:
-