public final class StringIterate
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
allSatisfy(java.lang.String string,
com.gs.collections.api.block.predicate.primitive.CharPredicate predicate) |
static boolean |
allSatisfy(java.lang.String string,
CodePointPredicate predicate) |
static boolean |
anySatisfy(java.lang.String string,
com.gs.collections.api.block.predicate.primitive.CharPredicate predicate) |
static boolean |
anySatisfy(java.lang.String string,
CodePointPredicate predicate) |
static com.gs.collections.api.set.MutableSet<java.lang.Character> |
asLowercaseSet(java.lang.String string)
Deprecated.
in 3.0. Inlineable.
|
static com.gs.collections.api.set.MutableSet<java.lang.Character> |
asUppercaseSet(java.lang.String string)
Deprecated.
in 3.0. Inlineable.
|
static java.lang.String |
collect(java.lang.String string,
CharFunction function)
Deprecated.
since 3.0. Use
collect(String, CharToCharFunction) instead. |
static java.lang.String |
collect(java.lang.String string,
com.gs.collections.api.block.function.primitive.CharToCharFunction function) |
static java.lang.String |
collect(java.lang.String string,
CodePointFunction function) |
static int |
count(java.lang.String string,
CharPredicate predicate)
Deprecated.
since 3.0.
|
static int |
count(java.lang.String string,
com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
Count the number of elements that return true for the specified
predicate. |
static int |
count(java.lang.String string,
CodePointPredicate predicate)
Count the number of elements that return true for the specified
predicate. |
static com.gs.collections.api.list.MutableList<java.lang.String> |
csvTokensToList(java.lang.String string)
Deprecated.
in 3.0. Inlineable. Poorly named method. Does not actually deal properly with CSV. This is better handled in a separate library.
|
static com.gs.collections.api.list.MutableList<java.lang.String> |
csvTokensToReverseSortedList(java.lang.String string)
Deprecated.
in 3.0. Inlineable. Poorly named method. Does not actually deal properly with CSV. This is better handled in a separate library.
|
static com.gs.collections.api.set.MutableSet<java.lang.String> |
csvTokensToSet(java.lang.String string)
Deprecated.
in 3.0. Inlineable. Poorly named method. Does not actually deal properly with CSV. This is better handled in a separate library.
|
static com.gs.collections.api.list.MutableList<java.lang.String> |
csvTokensToSortedList(java.lang.String string)
Deprecated.
in 3.0. Inlineable. Poorly named method. Does not actually deal properly with CSV. This is better handled in a separate library.
|
static com.gs.collections.api.list.MutableList<java.lang.String> |
csvTrimmedTokensToList(java.lang.String string)
Deprecated.
in 3.0. Inlineable. Poorly named method. Does not actually deal properly with CSV. This is better handled in a separate library.
|
static com.gs.collections.api.list.MutableList<java.lang.String> |
csvTrimmedTokensToSortedList(java.lang.String string)
Deprecated.
in 3.0. Inlineable. Poorly named method. Does not actually deal properly with CSV. This is better handled in a separate library.
|
static java.lang.Character |
detect(java.lang.String string,
com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
Find the first element that returns true for the specified
predicate. |
static java.lang.Character |
detectIfNone(java.lang.String string,
com.gs.collections.api.block.predicate.primitive.CharPredicate predicate,
char resultIfNone)
Find the first element that returns true for the specified
predicate. |
static java.lang.Character |
detectIfNone(java.lang.String string,
com.gs.collections.api.block.predicate.primitive.CharPredicate predicate,
java.lang.String resultIfNone)
Find the first element that returns true for the specified
predicate. |
static java.lang.String |
englishToLowerCase(java.lang.String string) |
static java.lang.String |
englishToUpperCase(java.lang.String string) |
static void |
forEach(java.lang.String string,
CharProcedure procedure)
Deprecated.
since 3.0. Use
forEach(String, CharProcedure) instead. |
static void |
forEach(java.lang.String string,
com.gs.collections.api.block.procedure.primitive.CharProcedure procedure)
For each character in the
string, execute the CharProcedure. |
static void |
forEach(java.lang.String string,
CodePointProcedure procedure)
For each character in the
string, execute the CodePointProcedure. |
static void |
forEachToken(java.lang.String string,
java.lang.String separator,
com.gs.collections.api.block.procedure.Procedure<java.lang.String> procedure)
For each token in a string separated by the specified separator, execute the specified StringProcedure
by calling the valueOfString method.
|
static void |
forEachTrimmedToken(java.lang.String string,
java.lang.String separator,
com.gs.collections.api.block.procedure.Procedure<java.lang.String> procedure)
For each token in a
string separated by the specified separator, execute the specified
Procedure. |
static java.lang.String |
getFirstToken(java.lang.String value,
java.lang.String separator) |
static java.lang.String |
getLastToken(java.lang.String value,
java.lang.String separator) |
static <T,R> R |
injectIntoTokens(java.lang.String string,
java.lang.String separator,
R injectedValue,
com.gs.collections.api.block.function.Function2<R,java.lang.String,R> function)
For each token in a string separated by the specified separator, execute the specified Function2,
returning the result value from the function.
|
static boolean |
isAlphaNumeric(java.lang.String string) |
static boolean |
isEmpty(java.lang.String string) |
static boolean |
isEmptyOrWhitespace(java.lang.String string) |
static boolean |
isNumber(java.lang.String string) |
static boolean |
noneSatisfy(java.lang.String string,
com.gs.collections.api.block.predicate.primitive.CharPredicate predicate) |
static boolean |
noneSatisfy(java.lang.String string,
CodePointPredicate predicate) |
static boolean |
notEmpty(java.lang.String string) |
static boolean |
notEmptyOrWhitespace(java.lang.String string) |
static int |
occurrencesOf(java.lang.String string,
char value)
Count the number of occurrences of the specified char.
|
static int |
occurrencesOf(java.lang.String string,
int value)
Count the number of occurrences of the specified code point.
|
static int |
occurrencesOf(java.lang.String string,
java.lang.String singleCharacter)
Count the number of occurrences of the specified
string. |
static java.lang.String |
padOrTrim(java.lang.String message,
int targetLength) |
static java.lang.String |
reject(java.lang.String string,
com.gs.collections.api.block.predicate.primitive.CharPredicate predicate) |
static java.lang.String |
reject(java.lang.String string,
CodePointPredicate predicate) |
static java.lang.String |
repeat(char c,
int repeatTimes) |
static java.lang.String |
repeat(java.lang.String template,
int repeatTimes) |
static void |
reverseForEach(java.lang.String string,
com.gs.collections.api.block.procedure.primitive.CharProcedure procedure)
For each character in the
string in reverse order, execute the CharProcedure. |
static void |
reverseForEach(java.lang.String string,
CodePointProcedure procedure)
For each character in the
string in reverse order, execute the CodePointProcedure. |
static java.lang.String |
select(java.lang.String string,
com.gs.collections.api.block.predicate.primitive.CharPredicate predicate) |
static java.lang.String |
select(java.lang.String string,
CodePointPredicate predicate) |
static com.gs.collections.api.tuple.Twin<java.lang.String> |
splitAtIndex(java.lang.String aString,
int index) |
static com.gs.collections.api.bag.MutableBag<java.lang.Character> |
toBag(java.lang.String string) |
static com.gs.collections.api.list.MutableList<java.lang.String> |
tokensToList(java.lang.String string,
java.lang.String separator)
Converts a string of tokens separated by the specified separator to a
MutableList. |
static com.gs.collections.api.map.MutableMap<java.lang.String,java.lang.String> |
tokensToMap(java.lang.String string)
Converts a string of tokens to a
MutableMap using a | to separate pairs, and a : to separate key and
value. |
static com.gs.collections.api.map.MutableMap<java.lang.String,java.lang.String> |
tokensToMap(java.lang.String string,
java.lang.String pairSeparator,
java.lang.String keyValueSeparator)
Converts a string of tokens to a
MutableMap using the specified separators. |
static <K,V> com.gs.collections.api.map.MutableMap<K,V> |
tokensToMap(java.lang.String string,
java.lang.String separator,
java.lang.String keyValueSeparator,
com.gs.collections.api.block.function.Function<java.lang.String,K> keyFunction,
com.gs.collections.api.block.function.Function<java.lang.String,V> valueFunction)
Converts a string of tokens to a
MutableMap using the specified 'key' and 'value'
Functions. |
static com.gs.collections.api.list.MutableList<java.lang.String> |
tokensToReverseSortedList(java.lang.String string,
java.lang.String separator)
Converts a string of tokens separated by the specified separator to a reverse sorted
MutableList. |
static com.gs.collections.api.set.MutableSet<java.lang.String> |
tokensToSet(java.lang.String string,
java.lang.String separator)
Converts a string of tokens to a
MutableSet. |
static com.gs.collections.api.list.MutableList<java.lang.String> |
tokensToSortedList(java.lang.String string,
java.lang.String separator)
Converts a string of tokens separated by the specified separator to a sorted
MutableList. |
static com.gs.collections.api.list.MutableList<java.lang.Character> |
toList(java.lang.String string) |
static com.gs.collections.api.bag.MutableBag<java.lang.Character> |
toLowercaseBag(java.lang.String string) |
static com.gs.collections.api.list.MutableList<java.lang.Character> |
toLowercaseList(java.lang.String string) |
static com.gs.collections.api.set.MutableSet<java.lang.Character> |
toLowercaseSet(java.lang.String string) |
static com.gs.collections.api.set.MutableSet<java.lang.Character> |
toSet(java.lang.String string) |
static com.gs.collections.api.bag.MutableBag<java.lang.Character> |
toUppercaseBag(java.lang.String string) |
static com.gs.collections.api.list.MutableList<java.lang.Character> |
toUppercaseList(java.lang.String string) |
static com.gs.collections.api.set.MutableSet<java.lang.Character> |
toUppercaseSet(java.lang.String string) |
static com.gs.collections.api.list.MutableList<java.lang.String> |
trimmedTokensToList(java.lang.String string,
java.lang.String separator)
Converts a string of tokens separated by the specified separator to a
MutableList. |
static com.gs.collections.api.list.MutableList<java.lang.String> |
trimmedTokensToSortedList(java.lang.String string,
java.lang.String separator)
Converts a string of tokens separated by the specified separator to a sorted
MutableList. |
@Deprecated public static com.gs.collections.api.list.MutableList<java.lang.String> csvTokensToSortedList(java.lang.String string)
MutableList.@Deprecated public static com.gs.collections.api.list.MutableList<java.lang.String> csvTrimmedTokensToSortedList(java.lang.String string)
MutableList.public static com.gs.collections.api.list.MutableList<java.lang.String> tokensToSortedList(java.lang.String string,
java.lang.String separator)
MutableList.public static com.gs.collections.api.list.MutableList<java.lang.String> trimmedTokensToSortedList(java.lang.String string,
java.lang.String separator)
MutableList.@Deprecated public static com.gs.collections.api.list.MutableList<java.lang.String> csvTokensToList(java.lang.String string)
MutableList.@Deprecated public static com.gs.collections.api.list.MutableList<java.lang.String> csvTrimmedTokensToList(java.lang.String string)
MutableList.public static com.gs.collections.api.list.MutableList<java.lang.String> tokensToList(java.lang.String string,
java.lang.String separator)
MutableList.public static com.gs.collections.api.list.MutableList<java.lang.String> trimmedTokensToList(java.lang.String string,
java.lang.String separator)
MutableList.@Deprecated public static com.gs.collections.api.set.MutableSet<java.lang.String> csvTokensToSet(java.lang.String string)
MutableSet.public static com.gs.collections.api.set.MutableSet<java.lang.String> tokensToSet(java.lang.String string,
java.lang.String separator)
MutableSet.public static com.gs.collections.api.map.MutableMap<java.lang.String,java.lang.String> tokensToMap(java.lang.String string)
MutableMap using a | to separate pairs, and a : to separate key and
value. e.g. "1:Sunday|2:Monday|3:Tuesday|4:Wednesday|5:Thursday|6:Friday|7:Saturday"public static com.gs.collections.api.map.MutableMap<java.lang.String,java.lang.String> tokensToMap(java.lang.String string,
java.lang.String pairSeparator,
java.lang.String keyValueSeparator)
MutableMap using the specified separators.public static <K,V> com.gs.collections.api.map.MutableMap<K,V> tokensToMap(java.lang.String string,
java.lang.String separator,
java.lang.String keyValueSeparator,
com.gs.collections.api.block.function.Function<java.lang.String,K> keyFunction,
com.gs.collections.api.block.function.Function<java.lang.String,V> valueFunction)
MutableMap using the specified 'key' and 'value'
Functions. e.g. "1:2,2:1,3:3" with both functions as Functions.getStringToInteger(), will be
translated a map {[1,2],[2,1],[3,3]}@Deprecated public static com.gs.collections.api.list.MutableList<java.lang.String> csvTokensToReverseSortedList(java.lang.String string)
MutableList.public static com.gs.collections.api.list.MutableList<java.lang.String> tokensToReverseSortedList(java.lang.String string,
java.lang.String separator)
MutableList.public static void forEachToken(java.lang.String string,
java.lang.String separator,
com.gs.collections.api.block.procedure.Procedure<java.lang.String> procedure)
public static <T,R> R injectIntoTokens(java.lang.String string,
java.lang.String separator,
R injectedValue,
com.gs.collections.api.block.function.Function2<R,java.lang.String,R> function)
Iterate.injectInto(Object, Iterable, Function2)public static void forEachTrimmedToken(java.lang.String string,
java.lang.String separator,
com.gs.collections.api.block.procedure.Procedure<java.lang.String> procedure)
string separated by the specified separator, execute the specified
Procedure.@Deprecated
public static void forEach(java.lang.String string,
CharProcedure procedure)
forEach(String, CharProcedure) instead.string, execute the CharProcedure.public static void forEach(java.lang.String string,
com.gs.collections.api.block.procedure.primitive.CharProcedure procedure)
string, execute the CharProcedure.public static void forEach(java.lang.String string,
CodePointProcedure procedure)
string, execute the CodePointProcedure.public static void reverseForEach(java.lang.String string,
com.gs.collections.api.block.procedure.primitive.CharProcedure procedure)
string in reverse order, execute the CharProcedure.public static void reverseForEach(java.lang.String string,
CodePointProcedure procedure)
string in reverse order, execute the CodePointProcedure.@Deprecated
public static int count(java.lang.String string,
CharPredicate predicate)
predicate.public static int count(java.lang.String string,
com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
predicate.public static int count(java.lang.String string,
CodePointPredicate predicate)
predicate.@Deprecated
public static java.lang.String collect(java.lang.String string,
CharFunction function)
collect(String, CharToCharFunction) instead.public static java.lang.String collect(java.lang.String string,
com.gs.collections.api.block.function.primitive.CharToCharFunction function)
public static java.lang.String collect(java.lang.String string,
CodePointFunction function)
public static java.lang.String englishToUpperCase(java.lang.String string)
public static java.lang.String englishToLowerCase(java.lang.String string)
public static java.lang.Character detect(java.lang.String string,
com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
predicate.public static java.lang.Character detectIfNone(java.lang.String string,
com.gs.collections.api.block.predicate.primitive.CharPredicate predicate,
char resultIfNone)
predicate. Return the default char if
no value is found.public static java.lang.Character detectIfNone(java.lang.String string,
com.gs.collections.api.block.predicate.primitive.CharPredicate predicate,
java.lang.String resultIfNone)
predicate. Return the first char of the
default string if no value is found.public static int occurrencesOf(java.lang.String string,
char value)
public static int occurrencesOf(java.lang.String string,
int value)
public static int occurrencesOf(java.lang.String string,
java.lang.String singleCharacter)
string.public static boolean anySatisfy(java.lang.String string,
com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
string answer true for the specified predicate.public static boolean anySatisfy(java.lang.String string,
CodePointPredicate predicate)
string answer true for the specified predicate.public static boolean allSatisfy(java.lang.String string,
com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
string answer true for the specified predicate.public static boolean allSatisfy(java.lang.String string,
CodePointPredicate predicate)
string answer true for the specified predicate.public static boolean noneSatisfy(java.lang.String string,
com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
string answer true for the specified predicate.public static boolean noneSatisfy(java.lang.String string,
CodePointPredicate predicate)
string answer true for the specified predicate.public static java.lang.String select(java.lang.String string,
com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
predicate.public static java.lang.String select(java.lang.String string,
CodePointPredicate predicate)
predicate.public static java.lang.String reject(java.lang.String string,
com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
predicate.public static java.lang.String reject(java.lang.String string,
CodePointPredicate predicate)
predicate.public static java.lang.String getLastToken(java.lang.String value,
java.lang.String separator)
public static java.lang.String getFirstToken(java.lang.String value,
java.lang.String separator)
public static boolean isEmpty(java.lang.String string)
public static boolean isEmptyOrWhitespace(java.lang.String string)
public static boolean isNumber(java.lang.String string)
public static boolean isAlphaNumeric(java.lang.String string)
public static boolean notEmpty(java.lang.String string)
public static boolean notEmptyOrWhitespace(java.lang.String string)
public static java.lang.String repeat(java.lang.String template,
int repeatTimes)
public static java.lang.String repeat(char c,
int repeatTimes)
public static java.lang.String padOrTrim(java.lang.String message,
int targetLength)
public static com.gs.collections.api.list.MutableList<java.lang.Character> toList(java.lang.String string)
public static com.gs.collections.api.list.MutableList<java.lang.Character> toLowercaseList(java.lang.String string)
public static com.gs.collections.api.list.MutableList<java.lang.Character> toUppercaseList(java.lang.String string)
public static com.gs.collections.api.bag.MutableBag<java.lang.Character> toBag(java.lang.String string)
public static com.gs.collections.api.bag.MutableBag<java.lang.Character> toLowercaseBag(java.lang.String string)
public static com.gs.collections.api.bag.MutableBag<java.lang.Character> toUppercaseBag(java.lang.String string)
public static com.gs.collections.api.set.MutableSet<java.lang.Character> toSet(java.lang.String string)
@Deprecated public static com.gs.collections.api.set.MutableSet<java.lang.Character> asUppercaseSet(java.lang.String string)
public static com.gs.collections.api.set.MutableSet<java.lang.Character> toUppercaseSet(java.lang.String string)
@Deprecated public static com.gs.collections.api.set.MutableSet<java.lang.Character> asLowercaseSet(java.lang.String string)
public static com.gs.collections.api.set.MutableSet<java.lang.Character> toLowercaseSet(java.lang.String string)
public static com.gs.collections.api.tuple.Twin<java.lang.String> splitAtIndex(java.lang.String aString,
int index)