public class ManCharSequenceExt
extends java.lang.Object
| Constructor and Description |
|---|
ManCharSequenceExt() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
all(java.lang.CharSequence thiz,
CharPredicate predicate) |
static boolean |
contains(java.lang.CharSequence thiz,
char ch) |
static boolean |
contains(java.lang.CharSequence thiz,
char ch,
boolean ignoreCase)
Returns
true if this char sequence contains the specified character char. |
static boolean |
contains(java.lang.CharSequence thiz,
java.lang.CharSequence other) |
static boolean |
contains(java.lang.CharSequence thiz,
java.lang.CharSequence other,
boolean ignoreCase)
Returns
true if this char sequence contains the specified other sequence of characters as a substring. |
static boolean |
endsWith(java.lang.CharSequence thiz,
char c)
Returns
true if this char sequence ends with the specified character. |
static boolean |
endsWith(java.lang.CharSequence thiz,
java.lang.CharSequence suffix)
Returns
true if this char sequence ends with the specified suffix. |
static boolean |
endsWithIgnoreCase(java.lang.CharSequence thiz,
char c) |
static boolean |
endsWithIgnoreCase(java.lang.CharSequence thiz,
java.lang.CharSequence suffix)
Returns
true if this char sequence ends with the specified prefix. |
static manifold.rt.api.util.Pair<java.lang.Integer,java.lang.String> |
findAnyOf(java.lang.CharSequence thiz,
java.util.Collection<java.lang.String> strings) |
static manifold.rt.api.util.Pair<java.lang.Integer,java.lang.String> |
findAnyOf(java.lang.CharSequence thiz,
java.util.Collection<java.lang.String> strings,
int startIndex) |
static manifold.rt.api.util.Pair<java.lang.Integer,java.lang.String> |
findAnyOf(java.lang.CharSequence thiz,
java.util.Collection<java.lang.String> strings,
int startIndex,
boolean ignoreCase)
Finds the first occurrence of any of the specified
strings in this char sequence,
starting from the specified startIndex and optionally ignoring the case. |
static manifold.rt.api.util.Pair<java.lang.Integer,java.lang.String> |
findLastAnyOf(java.lang.CharSequence thiz,
java.util.Collection<java.lang.String> strings) |
static manifold.rt.api.util.Pair<java.lang.Integer,java.lang.String> |
findLastAnyOf(java.lang.CharSequence thiz,
java.util.Collection<java.lang.String> strings,
int startIndex) |
static manifold.rt.api.util.Pair<java.lang.Integer,java.lang.String> |
findLastAnyOf(java.lang.CharSequence thiz,
java.util.Collection<java.lang.String> strings,
int startIndex,
boolean ignoreCase)
Finds the last occurrence of any of the specified
strings in this char sequence,
starting from the specified startIndex and optionally ignoring the case. |
static char |
first(java.lang.CharSequence thiz) |
static char |
get(java.lang.CharSequence thiz,
int index)
Implement the index operator to enable indexed access to characters such as
text[i]. |
static int |
indexOf(java.lang.CharSequence thiz,
int ch) |
static int |
indexOf(java.lang.CharSequence thiz,
int ch,
boolean ignoreCase) |
static int |
indexOf(java.lang.CharSequence thiz,
int ch,
int startIndex) |
static int |
indexOf(java.lang.CharSequence thiz,
int ch,
int startIndex,
boolean ignoreCase)
Returns the index within this string of the first occurrence of the specified character, starting from the specified
startIndex. |
static int |
indexOf(java.lang.CharSequence thiz,
java.lang.String string) |
static int |
indexOf(java.lang.CharSequence thiz,
java.lang.String string,
boolean ignoreCase) |
static int |
indexOf(java.lang.CharSequence thiz,
java.lang.String string,
int startIndex) |
static int |
indexOf(java.lang.CharSequence thiz,
java.lang.String string,
int startIndex,
boolean ignoreCase)
Returns the index within this char sequence of the first occurrence of the specified
string,
starting from the specified startIndex. |
static int |
indexOfAny(java.lang.CharSequence thiz,
char[] chars) |
static int |
indexOfAny(java.lang.CharSequence thiz,
char[] chars,
int startIndex) |
static int |
indexOfAny(java.lang.CharSequence thiz,
char[] chars,
int startIndex,
boolean ignoreCase)
Finds the index of the first occurrence of any of the specified
chars in this char sequence,
starting from the specified startIndex and optionally ignoring the case. |
static int |
indexOfAny(java.lang.CharSequence thiz,
java.util.Collection<java.lang.String> strings) |
static int |
indexOfAny(java.lang.CharSequence thiz,
java.util.Collection<java.lang.String> strings,
int startIndex) |
static int |
indexOfAny(java.lang.CharSequence thiz,
java.util.Collection<java.lang.String> strings,
int startIndex,
boolean ignoreCase)
Finds the index of the first occurrence of any of the specified
strings in this char sequence,
starting from the specified startIndex and optionally ignoring the case. |
static boolean |
isBlank(java.lang.CharSequence thiz)
Returns
true if this char sequence is empty or contains only whitespace characters. |
static boolean |
isEmpty(java.lang.CharSequence thiz)
Returns
true if this char sequence is empty (contains no characters). |
static boolean |
isNotEmpty(java.lang.CharSequence thiz)
Returns
true if this char sequence is not empty. |
static boolean |
isNullOrBlank(java.lang.CharSequence thiz)
Returns
true if this nullable char sequence is either null or empty or consists solely of whitespace characters. |
static boolean |
isNullOrEmpty(java.lang.CharSequence thiz)
Returns
true if this nullable char sequence is either null or empty. |
static char |
last(java.lang.CharSequence thiz) |
static int |
lastIndex(java.lang.CharSequence thiz)
Returns the index of the last character in the char sequence or -1 if it is empty.
|
static int |
lastIndexOf(java.lang.CharSequence thiz,
int ch) |
static int |
lastIndexOf(java.lang.CharSequence thiz,
int ch,
boolean ignoreCase) |
static int |
lastIndexOf(java.lang.CharSequence thiz,
int ch,
int startIndex) |
static int |
lastIndexOf(java.lang.CharSequence thiz,
int ch,
int startIndex,
boolean ignoreCase)
Returns the index within this char sequence of the last occurrence of the specified character,
starting from the specified
startIndex. |
static int |
lastIndexOf(java.lang.CharSequence thiz,
java.lang.String string) |
static int |
lastIndexOf(java.lang.CharSequence thiz,
java.lang.String string,
boolean ignoreCase) |
static int |
lastIndexOf(java.lang.CharSequence thiz,
java.lang.String string,
int startIndex) |
static int |
lastIndexOf(java.lang.CharSequence thiz,
java.lang.String string,
int startIndex,
boolean ignoreCase)
Returns the index within this char sequence of the last occurrence of the specified
string,
starting from the specified startIndex. |
static int |
lastIndexOfAny(java.lang.CharSequence thiz,
char[] chars) |
static int |
lastIndexOfAny(java.lang.CharSequence thiz,
char[] chars,
int startIndex) |
static int |
lastIndexOfAny(java.lang.CharSequence thiz,
char[] chars,
int startIndex,
boolean ignoreCase)
Finds the index of the last occurrence of any of the specified
chars in this char sequence,
starting from the specified startIndex and optionally ignoring the case. |
static int |
lastIndexOfAny(java.lang.CharSequence thiz,
java.util.Collection<java.lang.String> strings) |
static int |
lastIndexOfAny(java.lang.CharSequence thiz,
java.util.Collection<java.lang.String> strings,
int startIndex) |
static int |
lastIndexOfAny(java.lang.CharSequence thiz,
java.util.Collection<java.lang.String> strings,
int startIndex,
boolean ignoreCase)
Finds the index of the last occurrence of any of the specified
strings in this char sequence,
starting from the specified startIndex and optionally ignoring the case. |
static java.lang.CharSequence |
padEnd(java.lang.CharSequence thiz,
int length,
char padChar)
Returns a char sequence with content of this char sequence padded at the end
to the specified
length with the specified character or space. |
static java.lang.CharSequence |
padStart(java.lang.CharSequence thiz,
int length,
char padChar)
Returns a char sequence with content of this char sequence padded at the beginning
to the specified
length with the specified character or space. |
static java.lang.CharSequence |
removePrefix(java.lang.CharSequence thiz,
java.lang.CharSequence prefix)
If this char sequence starts with the given
prefix, returns a new char sequence
with the prefix removed. |
static java.lang.CharSequence |
removeSuffix(java.lang.CharSequence thiz,
java.lang.CharSequence suffix)
If this char sequence ends with the given
suffix, returns a new char sequence
with the suffix removed. |
static boolean |
startsWith(java.lang.CharSequence thiz,
char c)
Returns
true if this char sequence starts with the specified character. |
static boolean |
startsWith(java.lang.CharSequence thiz,
java.lang.CharSequence prefix)
Returns
true if this char sequence starts with the specified prefix. |
static boolean |
startsWithIgnoreCase(java.lang.CharSequence thiz,
char c) |
static boolean |
startsWithIgnoreCase(java.lang.CharSequence thiz,
java.lang.CharSequence prefix)
Returns
true if this char sequence starts with the specified prefix. |
static java.lang.String |
substring(java.lang.CharSequence thiz,
int startIndex) |
static java.lang.String |
substring(java.lang.CharSequence thiz,
int startIndex,
int endIndex)
Returns a substring of chars from a range of this char sequence starting at the
startIndex and ending right before the endIndex. |
static java.lang.CharSequence |
trim(java.lang.CharSequence thiz,
char... chars)
Returns a sub sequence of this char sequence having leading and trailing characters from the
chars array trimmed. |
static java.lang.CharSequence |
trim(java.lang.CharSequence thiz,
CharPredicate predicate)
Returns a sub sequence of this char sequence having leading and trailing characters matching the
predicate trimmed. |
static java.lang.CharSequence |
trimEnd(java.lang.CharSequence thiz)
Returns a sub sequence of this char sequence having trailing whitespace removed.
|
static java.lang.CharSequence |
trimEnd(java.lang.CharSequence thiz,
char... chars)
Returns a sub sequence of this char sequence having trailing characters from the
chars array trimmed. |
static java.lang.CharSequence |
trimEnd(java.lang.CharSequence thiz,
CharPredicate predicate)
Returns a sub sequence of this char sequence having trailing characters matching the
predicate trimmed. |
static java.lang.CharSequence |
trimStart(java.lang.CharSequence thiz)
Returns a sub sequence of this char sequence having leading whitespace removed.
|
static java.lang.CharSequence |
trimStart(java.lang.CharSequence thiz,
char... chars)
Returns a sub sequence of this char sequence having leading and trailing characters from the
chars array trimmed. |
static java.lang.CharSequence |
trimStart(java.lang.CharSequence thiz,
CharPredicate predicate)
Returns a sub sequence of this char sequence having leading characters matching the
predicate trimmed. |
public static java.lang.CharSequence trim(java.lang.CharSequence thiz,
CharPredicate predicate)
predicate trimmed.public static java.lang.CharSequence trimStart(java.lang.CharSequence thiz,
CharPredicate predicate)
predicate trimmed.public static java.lang.CharSequence trimEnd(java.lang.CharSequence thiz,
CharPredicate predicate)
predicate trimmed.public static java.lang.CharSequence trim(java.lang.CharSequence thiz,
char... chars)
chars array trimmed.public static java.lang.CharSequence trimStart(java.lang.CharSequence thiz,
char... chars)
chars array trimmed.public static java.lang.CharSequence trimEnd(java.lang.CharSequence thiz,
char... chars)
chars array trimmed.public static java.lang.CharSequence trimStart(java.lang.CharSequence thiz)
public static java.lang.CharSequence trimEnd(java.lang.CharSequence thiz)
public static java.lang.CharSequence padStart(java.lang.CharSequence thiz,
int length,
char padChar)
length with the specified character or space.length - the desired string length.padChar - the character to pad string with, if it has length less than the length specified.public static java.lang.CharSequence padEnd(java.lang.CharSequence thiz,
int length,
char padChar)
length with the specified character or space.length - the desired string length.padChar - the character to pad string with, if it has length less than the length specified.public static boolean isNullOrEmpty(java.lang.CharSequence thiz)
true if this nullable char sequence is either null or empty.public static boolean isEmpty(java.lang.CharSequence thiz)
true if this char sequence is empty (contains no characters).public static boolean isNotEmpty(java.lang.CharSequence thiz)
true if this char sequence is not empty.public static boolean isBlank(java.lang.CharSequence thiz)
true if this char sequence is empty or contains only whitespace characters.public static boolean all(java.lang.CharSequence thiz,
CharPredicate predicate)
public static boolean isNullOrBlank(java.lang.CharSequence thiz)
true if this nullable char sequence is either null or empty or consists solely of whitespace characters.public static int lastIndex(java.lang.CharSequence thiz)
public static java.lang.String substring(java.lang.CharSequence thiz,
int startIndex,
int endIndex)
startIndex and ending right before the endIndex.startIndex - the start index (inclusive).endIndex - the end index (exclusive). If not specified, the length of the char sequence is used.public static java.lang.String substring(java.lang.CharSequence thiz,
int startIndex)
public static java.lang.CharSequence removePrefix(java.lang.CharSequence thiz,
java.lang.CharSequence prefix)
prefix, returns a new char sequence
with the prefix removed. Otherwise, returns a new char sequence with the same characters.public static java.lang.CharSequence removeSuffix(java.lang.CharSequence thiz,
java.lang.CharSequence suffix)
suffix, returns a new char sequence
with the suffix removed. Otherwise, returns a new char sequence with the same characters.public static char first(java.lang.CharSequence thiz)
public static char last(java.lang.CharSequence thiz)
public static boolean startsWith(java.lang.CharSequence thiz,
char c)
true if this char sequence starts with the specified character.public static boolean startsWithIgnoreCase(java.lang.CharSequence thiz,
char c)
public static boolean endsWith(java.lang.CharSequence thiz,
char c)
true if this char sequence ends with the specified character.public static boolean endsWithIgnoreCase(java.lang.CharSequence thiz,
char c)
public static boolean startsWith(java.lang.CharSequence thiz,
java.lang.CharSequence prefix)
true if this char sequence starts with the specified prefix.public static boolean startsWithIgnoreCase(java.lang.CharSequence thiz,
java.lang.CharSequence prefix)
true if this char sequence starts with the specified prefix.public static boolean endsWith(java.lang.CharSequence thiz,
java.lang.CharSequence suffix)
true if this char sequence ends with the specified suffix.public static boolean endsWithIgnoreCase(java.lang.CharSequence thiz,
java.lang.CharSequence suffix)
true if this char sequence ends with the specified prefix.public static int indexOfAny(java.lang.CharSequence thiz,
char[] chars)
public static int indexOfAny(java.lang.CharSequence thiz,
char[] chars,
int startIndex)
public static int indexOfAny(java.lang.CharSequence thiz,
char[] chars,
int startIndex,
boolean ignoreCase)
chars in this char sequence,
starting from the specified startIndex and optionally ignoring the case.ignoreCase - true to ignore character case when matching a character.public static int lastIndexOfAny(java.lang.CharSequence thiz,
char[] chars)
public static int lastIndexOfAny(java.lang.CharSequence thiz,
char[] chars,
int startIndex)
public static int lastIndexOfAny(java.lang.CharSequence thiz,
char[] chars,
int startIndex,
boolean ignoreCase)
chars in this char sequence,
starting from the specified startIndex and optionally ignoring the case.startIndex - The index of character to start searching at. The search proceeds backward toward the beginning of the string.ignoreCase - true to ignore character case when matching a character.public static manifold.rt.api.util.Pair<java.lang.Integer,java.lang.String> findAnyOf(java.lang.CharSequence thiz, java.util.Collection<java.lang.String> strings)
public static manifold.rt.api.util.Pair<java.lang.Integer,java.lang.String> findAnyOf(java.lang.CharSequence thiz, java.util.Collection<java.lang.String> strings, int startIndex)
public static manifold.rt.api.util.Pair<java.lang.Integer,java.lang.String> findAnyOf(java.lang.CharSequence thiz, java.util.Collection<java.lang.String> strings, int startIndex, boolean ignoreCase)
strings in this char sequence,
starting from the specified startIndex and optionally ignoring the case.ignoreCase - true to ignore character case when matching a string.public static manifold.rt.api.util.Pair<java.lang.Integer,java.lang.String> findLastAnyOf(java.lang.CharSequence thiz, java.util.Collection<java.lang.String> strings)
public static manifold.rt.api.util.Pair<java.lang.Integer,java.lang.String> findLastAnyOf(java.lang.CharSequence thiz, java.util.Collection<java.lang.String> strings, int startIndex)
public static manifold.rt.api.util.Pair<java.lang.Integer,java.lang.String> findLastAnyOf(java.lang.CharSequence thiz, java.util.Collection<java.lang.String> strings, int startIndex, boolean ignoreCase)
strings in this char sequence,
starting from the specified startIndex and optionally ignoring the case.startIndex - The index of character to start searching at. The search proceeds backward toward the beginning of the string.ignoreCase - true to ignore character case when matching a string.public static int indexOfAny(java.lang.CharSequence thiz,
java.util.Collection<java.lang.String> strings)
public static int indexOfAny(java.lang.CharSequence thiz,
java.util.Collection<java.lang.String> strings,
int startIndex)
public static int indexOfAny(java.lang.CharSequence thiz,
java.util.Collection<java.lang.String> strings,
int startIndex,
boolean ignoreCase)
strings in this char sequence,
starting from the specified startIndex and optionally ignoring the case.ignoreCase - true to ignore character case when matching a string.public static int lastIndexOfAny(java.lang.CharSequence thiz,
java.util.Collection<java.lang.String> strings)
public static int lastIndexOfAny(java.lang.CharSequence thiz,
java.util.Collection<java.lang.String> strings,
int startIndex)
public static int lastIndexOfAny(java.lang.CharSequence thiz,
java.util.Collection<java.lang.String> strings,
int startIndex,
boolean ignoreCase)
strings in this char sequence,
starting from the specified startIndex and optionally ignoring the case.startIndex - The index of character to start searching at. The search proceeds backward toward the beginning of the string.ignoreCase - true to ignore character case when matching a string.public static int indexOf(java.lang.CharSequence thiz,
int ch)
public static int indexOf(java.lang.CharSequence thiz,
int ch,
boolean ignoreCase)
public static int indexOf(java.lang.CharSequence thiz,
int ch,
int startIndex)
public static int indexOf(java.lang.CharSequence thiz,
int ch,
int startIndex,
boolean ignoreCase)
startIndex.ignoreCase - true to ignore character case when matching a character.public static int indexOf(java.lang.CharSequence thiz,
java.lang.String string)
public static int indexOf(java.lang.CharSequence thiz,
java.lang.String string,
boolean ignoreCase)
public static int indexOf(java.lang.CharSequence thiz,
java.lang.String string,
int startIndex)
public static int indexOf(java.lang.CharSequence thiz,
java.lang.String string,
int startIndex,
boolean ignoreCase)
string,
starting from the specified startIndex.ignoreCase - true to ignore character case when matching a string.public static int lastIndexOf(java.lang.CharSequence thiz,
int ch)
public static int lastIndexOf(java.lang.CharSequence thiz,
int ch,
boolean ignoreCase)
public static int lastIndexOf(java.lang.CharSequence thiz,
int ch,
int startIndex)
public static int lastIndexOf(java.lang.CharSequence thiz,
int ch,
int startIndex,
boolean ignoreCase)
startIndex.startIndex - The index of character to start searching at. The search proceeds backward toward the beginning of the string.ignoreCase - true to ignore character case when matching a character.public static int lastIndexOf(java.lang.CharSequence thiz,
java.lang.String string)
public static int lastIndexOf(java.lang.CharSequence thiz,
java.lang.String string,
boolean ignoreCase)
public static int lastIndexOf(java.lang.CharSequence thiz,
java.lang.String string,
int startIndex)
public static int lastIndexOf(java.lang.CharSequence thiz,
java.lang.String string,
int startIndex,
boolean ignoreCase)
string,
starting from the specified startIndex.startIndex - The index of character to start searching at. The search proceeds backward toward the beginning of the string.ignoreCase - true to ignore character case when matching a string.public static boolean contains(java.lang.CharSequence thiz,
java.lang.CharSequence other)
public static boolean contains(java.lang.CharSequence thiz,
java.lang.CharSequence other,
boolean ignoreCase)
true if this char sequence contains the specified other sequence of characters as a substring.ignoreCase - true to ignore character case when comparing strings.public static boolean contains(java.lang.CharSequence thiz,
char ch)
public static boolean contains(java.lang.CharSequence thiz,
char ch,
boolean ignoreCase)
true if this char sequence contains the specified character char.ignoreCase - true to ignore character case when comparing characters.public static char get(java.lang.CharSequence thiz,
int index)
text[i].index - the index of the char value.char value at the specified index of this string.
The first char value is at index 0.java.lang.IndexOutOfBoundsException - if the index
argument is negative or not less than the length of this
string.Copyright © 2021. All rights reserved.