public static final class StringUtil.MoreStringUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static String[] |
copyThenStrip(String[] strs) |
static String[] |
copyThenTrim(String[] strs) |
static u.Optional<String> |
substring(String str,
char delimiterOfInclusiveBeginIndex)
Returns an empty
Optional if N.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0,
otherwise an Optional with String value: str.substring(str.indexOf(delimiterOfInclusiveBeginIndex)) is returned. |
static u.Optional<String> |
substring(String str,
char delimiterOfInclusiveBeginIndex,
int exclusiveEndIndex) |
static u.Optional<String> |
substring(String str,
int inclusiveBeginIndex)
Returns an empty
Optional if inclusiveBeginIndex < 0,
otherwise an Optional with String value: str.substring(inclusiveBeginIndex) is returned. |
static u.Optional<String> |
substring(String str,
int inclusiveBeginIndex,
char delimiterOfExclusiveEndIndex) |
static u.Optional<String> |
substring(String str,
int inclusiveBeginIndex,
int exclusiveEndIndex)
Returns an empty
Optional if inclusiveBeginIndex < 0 || exclusiveEndIndex < 0 || inclusiveBeginIndex > exclusiveEndIndex,
otherwise an Optional with String value: str.substring(exclusiveBeginIndex, exclusiveEndIndex) is returned. |
static u.Optional<String> |
substring(String str,
int inclusiveBeginIndex,
IntUnaryOperator funcOfExclusiveEndIndex) |
static u.Optional<String> |
substring(String str,
int inclusiveBeginIndex,
String delimiterOfExclusiveEndIndex) |
static u.Optional<String> |
substring(String str,
IntUnaryOperator funcOfInclusiveBeginIndex,
int exclusiveEndIndex) |
static u.Optional<String> |
substring(String str,
String delimiterOfInclusiveBeginIndex)
Returns an empty
Optional if N.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0,
otherwise an Optional with String value: str.substring(str.indexOf(delimiterOfInclusiveBeginIndex)) is returned. |
static u.Optional<String> |
substring(String str,
String delimiterOfInclusiveBeginIndex,
int exclusiveEndIndex) |
static u.Optional<String> |
substringAfter(String str,
String delimiterOfExclusiveBeginIndex)
Returns the substring after first
delimiterOfExclusiveBeginIndex if it exists, otherwise return null String. |
static u.Optional<String> |
substringAfterLast(String str,
String delimiterOfExclusiveBeginIndex)
Returns the substring after last
delimiterOfExclusiveBeginIndex if it exists, otherwise return null String. |
static u.Optional<String> |
substringBefore(String str,
String delimiterOfExclusiveEndIndex)
Returns the substring before first
delimiterOfExclusiveBeginIndex if it exists, otherwise return null String. |
static u.Optional<String> |
substringBeforeLast(String str,
String delimiterOfExclusiveEndIndex)
Returns the substring last first
delimiterOfExclusiveBeginIndex if it exists, otherwise return null String. |
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 empty
Optional if exclusiveBeginIndex < 0 || exclusiveEndIndex < 0 || exclusiveBeginIndex >= exclusiveEndIndex,
otherwise an Optional with String value: str.substring(exclusiveBeginIndex + 1, exclusiveEndIndex) is returned. |
static u.Optional<String> |
substringBetween(String str,
int exclusiveBeginIndex,
IntUnaryOperator funcOfExclusiveEndIndex) |
static u.Optional<String> |
substringBetween(String str,
int exclusiveBeginIndex,
String delimiterOfExclusiveEndIndex) |
static u.Optional<String> |
substringBetween(String str,
IntUnaryOperator funcOfExclusiveBeginIndex,
int exclusiveEndIndex) |
static u.Optional<String> |
substringBetween(String str,
String delimiterOfExclusiveBeginIndex,
int exclusiveEndIndex) |
static u.Optional<String> |
substringBetween(String str,
String delimiterOfExclusiveBeginIndex,
String delimiterOfExclusiveEndIndex) |
public static u.Optional<String> substring(String str, int inclusiveBeginIndex, int exclusiveEndIndex)
Optional if inclusiveBeginIndex < 0 || exclusiveEndIndex < 0 || inclusiveBeginIndex > exclusiveEndIndex,
otherwise an Optional with String value: str.substring(exclusiveBeginIndex, exclusiveEndIndex) is returned.str - inclusiveBeginIndex - exclusiveEndIndex - StringUtil.substring(String, int, int)public static u.Optional<String> substring(String str, int inclusiveBeginIndex)
Optional if inclusiveBeginIndex < 0,
otherwise an Optional with String value: str.substring(inclusiveBeginIndex) is returned.str - inclusiveBeginIndex - StringUtil.substring(String, int)public static u.Optional<String> substring(String str, char delimiterOfInclusiveBeginIndex)
Optional if N.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0,
otherwise an Optional with String value: str.substring(str.indexOf(delimiterOfInclusiveBeginIndex)) is returned.str - delimiterOfInclusiveBeginIndex - inclusiveBeginIndex <- str.indexOf(delimiterOfInclusiveBeginIndex)StringUtil.substring(String, char)public static u.Optional<String> substring(String str, String delimiterOfInclusiveBeginIndex)
Optional if N.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0,
otherwise an Optional with String value: str.substring(str.indexOf(delimiterOfInclusiveBeginIndex)) is returned.str - delimiterOfInclusiveBeginIndex - inclusiveBeginIndex <- str.indexOf(delimiterOfInclusiveBeginIndex)StringUtil.substring(String, String)public static u.Optional<String> substring(String str, int inclusiveBeginIndex, char delimiterOfExclusiveEndIndex)
str - inclusiveBeginIndex - delimiterOfExclusiveEndIndex - exclusiveEndIndex <- str.indexOf(delimiterOfExclusiveEndIndex, inclusiveBeginIndex + 1) if inclusiveBeginIndex >= 0StringUtil.substring(String, int, char)public static u.Optional<String> substring(String str, int inclusiveBeginIndex, String delimiterOfExclusiveEndIndex)
str - inclusiveBeginIndex - delimiterOfExclusiveEndIndex - exclusiveEndIndex <- str.indexOf(delimiterOfExclusiveEndIndex, inclusiveBeginIndex + 1) if inclusiveBeginIndex >= 0StringUtil.substring(String, int, String)public static u.Optional<String> substring(String str, int inclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex)
str - inclusiveBeginIndex - funcOfExclusiveEndIndex - exclusiveEndIndex <- funcOfExclusiveEndIndex.applyAsInt(inclusiveBeginIndex) if inclusiveBeginIndex >= 0StringUtil.substring(String, int, IntUnaryOperator)public static u.Optional<String> substring(String str, char delimiterOfInclusiveBeginIndex, int exclusiveEndIndex)
str - delimiterOfInclusiveBeginIndex - inclusiveBeginIndex <- str.lastIndexOf(delimiterOfInclusiveBeginIndex, exclusiveEndIndex - 1) if exclusiveEndIndex > 0exclusiveEndIndex - StringUtil.substring(String, char, int)public static u.Optional<String> substring(String str, String delimiterOfInclusiveBeginIndex, int exclusiveEndIndex)
str - delimiterOfInclusiveBeginIndex - inclusiveBeginIndex <- str.lastIndexOf(delimiterOfInclusiveBeginIndex, exclusiveEndIndex - 1) if exclusiveEndIndex > 0exclusiveEndIndex - StringUtil.substring(String, String, int)public static u.Optional<String> substring(String str, IntUnaryOperator funcOfInclusiveBeginIndex, int exclusiveEndIndex)
str - funcOfInclusiveBeginIndex - inclusiveBeginIndex <- funcOfInclusiveBeginIndex.applyAsInt(exclusiveEndIndex)) if exclusiveEndIndex > 0exclusiveEndIndex - StringUtil.substring(String, IntUnaryOperator, int)public static u.Optional<String> substringBetween(String str, int exclusiveBeginIndex, int exclusiveEndIndex)
Optional if exclusiveBeginIndex < 0 || exclusiveEndIndex < 0 || exclusiveBeginIndex >= exclusiveEndIndex,
otherwise an Optional with String value: str.substring(exclusiveBeginIndex + 1, exclusiveEndIndex) is returned.str - exclusiveBeginIndex - exclusiveEndIndex - StringUtil.substringBetween(String, int, int)public static u.Optional<String> substringBetween(String str, int exclusiveBeginIndex, char delimiterOfExclusiveEndIndex)
str - exclusiveBeginIndex - delimiterOfExclusiveEndIndex - exclusiveEndIndex <- str.indexOf(delimiterOfExclusiveEndIndex, beginIndex + 1) if exclusiveBeginIndex >= 0StringUtil.substringBetween(String, int, char)public static u.Optional<String> substringBetween(String str, int exclusiveBeginIndex, String delimiterOfExclusiveEndIndex)
str - exclusiveBeginIndex - delimiterOfExclusiveEndIndex - exclusiveEndIndex <- str.indexOf(delimiterOfExclusiveEndIndex, beginIndex + 1) if exclusiveBeginIndex >= 0StringUtil.substringBetween(String, int, String)public static u.Optional<String> substringBetween(String str, int exclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex)
str - exclusiveBeginIndex - funcOfExclusiveEndIndex - exclusiveEndIndex <- funcOfExclusiveEndIndex.applyAsInt(inclusiveBeginIndex) if inclusiveBeginIndex >= 0StringUtil.substringBetween(String, int, IntUnaryOperator)public static u.Optional<String> substringBetween(String str, char delimiterOfExclusiveBeginIndex, int exclusiveEndIndex)
str - delimiterOfExclusiveBeginIndex - exclusiveBeginIndex <- str.lastIndexOf(delimiterOfExclusiveBeginIndex, exclusiveEndIndex - 1) if exclusiveEndIndex > 0exclusiveEndIndex - StringUtil.substringBetween(String, char, int)public static u.Optional<String> substringBetween(String str, String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex)
str - delimiterOfExclusiveBeginIndex - exclusiveBeginIndex <- str.lastIndexOf(delimiterOfExclusiveBeginIndex, exclusiveEndIndex - 1) + delimiterOfExclusiveBeginIndex.length() - 1 if exclusiveEndIndex > 0exclusiveEndIndex - StringUtil.substringBetween(String, String, int)public static u.Optional<String> substringBetween(String str, IntUnaryOperator funcOfExclusiveBeginIndex, int exclusiveEndIndex)
str - funcOfExclusiveBeginIndex - exclusiveBeginIndex <- funcOfExclusiveBeginIndex.applyAsInt(exclusiveEndIndex)) if exclusiveEndIndex > 0exclusiveEndIndex - StringUtil.substringBetween(String, IntUnaryOperator, int)public static u.Optional<String> substringBetween(String str, char delimiterOfExclusiveBeginIndex, char delimiterOfExclusiveEndIndex)
str - delimiterOfExclusiveBeginIndex - delimiterOfExclusiveBeginIndex - StringUtil.substringBetween(String, char, char)public static u.Optional<String> substringBetween(String str, String delimiterOfExclusiveBeginIndex, String delimiterOfExclusiveEndIndex)
str - delimiterOfExclusiveBeginIndex - delimiterOfExclusiveBeginIndex - StringUtil.substringBetween(String, String, String)public static u.Optional<String> substringAfter(String str, String delimiterOfExclusiveBeginIndex)
delimiterOfExclusiveBeginIndex if it exists, otherwise return null String.str - delimiterOfExclusiveBeginIndex - StringUtil.substringAfter(String, String)public static u.Optional<String> substringAfterLast(String str, String delimiterOfExclusiveBeginIndex)
delimiterOfExclusiveBeginIndex if it exists, otherwise return null String.str - delimiterOfExclusiveBeginIndex - StringUtil.substringAfterLast(String, String)public static u.Optional<String> substringBefore(String str, String delimiterOfExclusiveEndIndex)
delimiterOfExclusiveBeginIndex if it exists, otherwise return null String.str - delimiterOfExclusiveEndIndex - StringUtil.substringBefore(String, String)public static u.Optional<String> substringBeforeLast(String str, String delimiterOfExclusiveEndIndex)
delimiterOfExclusiveBeginIndex if it exists, otherwise return null String.str - delimiterOfExclusiveEndIndex - StringUtil.substringBeforeLast(String, String)@Beta public static String[] copyThenTrim(String[] strs)
strs - N.copyThenApply(Object[], com.landawn.abacus.util.Throwables.Function),
Fn.trim(),
Fn.trimToEmpty(),
Fn.trimToNull()@Beta public static String[] copyThenStrip(String[] strs)
strs - N.copyThenApply(Object[], com.landawn.abacus.util.Throwables.Function),
Fn.strip(),
Fn.stripToEmpty(),
Fn.stripToNull()Copyright © 2021. All rights reserved.