public final class StringIterate extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
allSatisfy(String string,
CharPredicate predicate)
Deprecated.
since 7.0. Use
allSatisfyChar(String, CharPredicate) instead. |
static boolean |
allSatisfy(String string,
CodePointPredicate predicate)
Deprecated.
since 7.0. Use
allSatisfyCodePoint(String, CodePointPredicate) instead. |
static boolean |
allSatisfyChar(String string,
CharPredicate predicate) |
static boolean |
allSatisfyCodePoint(String string,
CodePointPredicate predicate) |
static boolean |
anySatisfy(String string,
CharPredicate predicate)
Deprecated.
since 7.0. Use
anySatisfyChar(String, CharPredicate) instead. |
static boolean |
anySatisfy(String string,
CodePointPredicate predicate)
Deprecated.
since 7.0. Use
anySatisfyCodePoint(String, CodePointPredicate) instead. |
static boolean |
anySatisfyChar(String string,
CharPredicate predicate) |
static boolean |
anySatisfyCodePoint(String string,
CodePointPredicate predicate) |
static CharAdapter |
asCharAdapter(String string) |
static CodePointAdapter |
asCodePointAdapter(String string) |
static MutableSet<Character> |
asLowercaseSet(String string)
Deprecated.
in 3.0. Inlineable.
|
static MutableSet<Character> |
asUppercaseSet(String string)
Deprecated.
in 3.0. Inlineable.
|
static MutableList<String> |
chunk(String string,
int size)
Partitions String in fixed size chunks.
|
static String |
collect(String string,
CharFunction function)
Deprecated.
since 3.0. Use
collect(String, CharToCharFunction) instead. |
static String |
collect(String string,
CharToCharFunction function)
Deprecated.
since 7.0. Use
collectChar(String, CharToCharFunction) instead. |
static String |
collect(String string,
CodePointFunction function)
Deprecated.
since 7.0. Use
collectCodePoint(String, CodePointFunction) instead. |
static String |
collectChar(String string,
CharToCharFunction function)
Transform the char elements to a new string using the specified function
function . |
static String |
collectCodePoint(String string,
CodePointFunction function)
Transform the int code point elements to a new string using the specified function
function . |
static int |
count(String string,
CharPredicate predicate)
Deprecated.
since 3.0.
|
static int |
count(String string,
CharPredicate predicate)
Deprecated.
since 7.0. Use
countChar(String, CharPredicate) instead. |
static int |
count(String string,
CodePointPredicate predicate)
Deprecated.
since 7.0. Use
countCodePoint(String, CodePointPredicate) instead. |
static int |
countChar(String string,
CharPredicate predicate)
Count the number of elements that return true for the specified
predicate . |
static int |
countCodePoint(String string,
CodePointPredicate predicate)
Count the number of elements that return true for the specified
predicate . |
static MutableList<String> |
csvTokensToList(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 MutableList<String> |
csvTokensToReverseSortedList(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 MutableSet<String> |
csvTokensToSet(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 MutableList<String> |
csvTokensToSortedList(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 MutableList<String> |
csvTrimmedTokensToList(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 MutableList<String> |
csvTrimmedTokensToSortedList(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 Character |
detect(String string,
CharPredicate predicate)
Deprecated.
since 7.0. Use
detectChar(String, CharPredicate) instead. |
static Character |
detectChar(String string,
CharPredicate predicate)
Find the first element that returns true for the specified
predicate . |
static Character |
detectCharIfNone(String string,
CharPredicate predicate,
char resultIfNone)
Find the first element that returns true for the specified
predicate . |
static Character |
detectCharIfNone(String string,
CharPredicate predicate,
String resultIfNone)
Find the first element that returns true for the specified
predicate . |
static Character |
detectIfNone(String string,
CharPredicate predicate,
char resultIfNone)
Deprecated.
since 7.0. Use
detectCharIfNone(String, CharPredicate, char) instead. |
static Character |
detectIfNone(String string,
CharPredicate predicate,
String resultIfNone)
Deprecated.
since 7.0. Use
detectCharIfNone(String, CharPredicate, String) instead. |
static String |
englishToLowerCase(String string) |
static String |
englishToUpperCase(String string) |
static void |
forEach(String string,
CharProcedure procedure)
Deprecated.
since 3.0. Use
forEach(String, CharProcedure) instead. |
static void |
forEach(String string,
CharProcedure procedure)
Deprecated.
since 7.0. Use
forEachChar(String, CharProcedure) instead. |
static void |
forEach(String string,
CodePointProcedure procedure)
Deprecated.
since 7.0. Use
forEachCodePoint(String, CodePointProcedure) instead. |
static void |
forEachChar(String string,
CharProcedure procedure)
For each char in the
string , execute the CharProcedure . |
static void |
forEachCodePoint(String string,
CodePointProcedure procedure)
For each int code point in the
string , execute the CodePointProcedure . |
static void |
forEachToken(String string,
String separator,
Procedure<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(String string,
String separator,
Procedure<String> procedure)
|
static String |
getFirstToken(String value,
String separator) |
static String |
getLastToken(String value,
String separator) |
static <T,R> R |
injectIntoTokens(String string,
String separator,
R injectedValue,
Function2<R,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(String string) |
static boolean |
isEmpty(String string) |
static boolean |
isEmptyOrWhitespace(String string) |
static boolean |
isNumber(String string) |
static boolean |
isSurrogate(String string,
int i) |
static boolean |
noneSatisfy(String string,
CharPredicate predicate)
Deprecated.
since 7.0. Use
noneSatisfyChar(String, CharPredicate) instead. |
static boolean |
noneSatisfy(String string,
CodePointPredicate predicate)
Deprecated.
since 7.0. Use
noneSatisfyCodePoint(String, CodePointPredicate) instead. |
static boolean |
noneSatisfyChar(String string,
CharPredicate predicate) |
static boolean |
noneSatisfyCodePoint(String string,
CodePointPredicate predicate) |
static boolean |
notEmpty(String string) |
static boolean |
notEmptyOrWhitespace(String string) |
static int |
numberOfChars(String string,
int i) |
static int |
occurrencesOf(String string,
char value)
Deprecated.
since 7.0. Use
occurrencesOfChar(String, char) instead. |
static int |
occurrencesOf(String string,
int value)
Deprecated.
since 7.0. Use
occurrencesOfCodePoint(String, int) instead. |
static int |
occurrencesOf(String string,
String singleCharacter)
Count the number of occurrences of the specified
string . |
static int |
occurrencesOfChar(String string,
char value)
Count the number of occurrences of the specified char.
|
static int |
occurrencesOfCodePoint(String string,
int value)
Count the number of occurrences of the specified int code point.
|
static String |
padOrTrim(String message,
int targetLength) |
static String |
reject(String string,
CharPredicate predicate)
Deprecated.
since 7.0. Use
rejectChar(String, CharPredicate) instead. |
static String |
reject(String string,
CodePointPredicate predicate)
Deprecated.
since 7.0. Use
rejectCodePoint(String, CodePointPredicate) instead. |
static String |
rejectChar(String string,
CharPredicate predicate) |
static String |
rejectCodePoint(String string,
CodePointPredicate predicate) |
static String |
repeat(char c,
int repeatTimes) |
static String |
repeat(String template,
int repeatTimes) |
static void |
reverseForEach(String string,
CharProcedure procedure)
Deprecated.
since 7.0. Use
reverseForEachChar(String, CharProcedure) instead. |
static void |
reverseForEach(String string,
CodePointProcedure procedure)
Deprecated.
since 7.0. Use
reverseForEachCodePoint(String, CodePointProcedure) instead. |
static void |
reverseForEachChar(String string,
CharProcedure procedure)
For each char in the
string in reverse order, execute the CharProcedure . |
static void |
reverseForEachCodePoint(String string,
CodePointProcedure procedure)
For each int code point in the
string in reverse order, execute the CodePointProcedure . |
static String |
select(String string,
CharPredicate predicate)
Deprecated.
since 7.0. Use
selectChar(String, CharPredicate) instead. |
static String |
select(String string,
CodePointPredicate predicate)
Deprecated.
since 7.0. Use
selectCodePoint(String, CodePointPredicate) instead. |
static String |
selectChar(String string,
CharPredicate predicate) |
static String |
selectCodePoint(String string,
CodePointPredicate predicate) |
static Twin<String> |
splitAtIndex(String aString,
int index) |
static MutableBag<Character> |
toBag(String string) |
static CodePointList |
toCodePointList(String string) |
static MutableList<String> |
tokensToList(String string,
String separator)
Converts a string of tokens separated by the specified separator to a
MutableList . |
static MutableMap<String,String> |
tokensToMap(String string)
Converts a string of tokens to a
MutableMap using a | to separate pairs, and a : to separate key and
value. |
static MutableMap<String,String> |
tokensToMap(String string,
String pairSeparator,
String keyValueSeparator)
Converts a string of tokens to a
MutableMap using the specified separators. |
static <K,V> MutableMap<K,V> |
tokensToMap(String string,
String separator,
String keyValueSeparator,
Function<String,K> keyFunction,
Function<String,V> valueFunction)
Converts a string of tokens to a
MutableMap using the specified 'key' and 'value'
Functions. |
static MutableList<String> |
tokensToReverseSortedList(String string,
String separator)
Converts a string of tokens separated by the specified separator to a reverse sorted
MutableList . |
static MutableSet<String> |
tokensToSet(String string,
String separator)
Converts a string of tokens to a
MutableSet . |
static MutableList<String> |
tokensToSortedList(String string,
String separator)
Converts a string of tokens separated by the specified separator to a sorted
MutableList . |
static MutableList<Character> |
toList(String string) |
static MutableBag<Character> |
toLowercaseBag(String string) |
static MutableList<Character> |
toLowercaseList(String string) |
static MutableSet<Character> |
toLowercaseSet(String string) |
static MutableSet<Character> |
toSet(String string) |
static MutableBag<Character> |
toUppercaseBag(String string) |
static MutableList<Character> |
toUppercaseList(String string) |
static MutableSet<Character> |
toUppercaseSet(String string) |
static MutableList<String> |
trimmedTokensToList(String string,
String separator)
Converts a string of tokens separated by the specified separator to a
MutableList . |
static MutableList<String> |
trimmedTokensToSortedList(String string,
String separator)
Converts a string of tokens separated by the specified separator to a sorted
MutableList . |
public static CharAdapter asCharAdapter(String string)
public static CodePointAdapter asCodePointAdapter(String string)
public static CodePointList toCodePointList(String string)
@Deprecated public static MutableList<String> csvTokensToSortedList(String string)
MutableList
.@Deprecated public static MutableList<String> csvTrimmedTokensToSortedList(String string)
MutableList
.public static MutableList<String> tokensToSortedList(String string, String separator)
MutableList
.public static MutableList<String> trimmedTokensToSortedList(String string, String separator)
MutableList
.@Deprecated public static MutableList<String> csvTokensToList(String string)
MutableList
.@Deprecated public static MutableList<String> csvTrimmedTokensToList(String string)
MutableList
.public static MutableList<String> tokensToList(String string, String separator)
MutableList
.public static MutableList<String> trimmedTokensToList(String string, String separator)
MutableList
.@Deprecated public static MutableSet<String> csvTokensToSet(String string)
MutableSet
.public static MutableSet<String> tokensToSet(String string, String separator)
MutableSet
.public static MutableMap<String,String> tokensToMap(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 MutableMap<String,String> tokensToMap(String string, String pairSeparator, String keyValueSeparator)
MutableMap
using the specified separators.public static <K,V> MutableMap<K,V> tokensToMap(String string, String separator, String keyValueSeparator, Function<String,K> keyFunction, Function<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 MutableList<String> csvTokensToReverseSortedList(String string)
MutableList
.public static MutableList<String> tokensToReverseSortedList(String string, String separator)
MutableList
.public static void forEachToken(String string, String separator, Procedure<String> procedure)
public static <T,R> R injectIntoTokens(String string, String separator, R injectedValue, Function2<R,String,R> function)
Iterate.injectInto(Object, Iterable, Function2)
public static void forEachTrimmedToken(String string, String separator, Procedure<String> procedure)
@Deprecated public static void forEach(String string, CharProcedure procedure)
forEach(String, CharProcedure)
instead.string
, execute the CharProcedure
.@Deprecated public static void forEach(String string, CharProcedure procedure)
forEachChar(String, CharProcedure)
instead.string
, execute the CharProcedure
.public static void forEachChar(String string, CharProcedure procedure)
string
, execute the CharProcedure
.@Deprecated public static void forEach(String string, CodePointProcedure procedure)
forEachCodePoint(String, CodePointProcedure)
instead.string
, execute the CodePointProcedure
.public static void forEachCodePoint(String string, CodePointProcedure procedure)
string
, execute the CodePointProcedure
.@Deprecated public static void reverseForEach(String string, CharProcedure procedure)
reverseForEachChar(String, CharProcedure)
instead.string
in reverse order, execute the CharProcedure
.public static void reverseForEachChar(String string, CharProcedure procedure)
string
in reverse order, execute the CharProcedure
.@Deprecated public static void reverseForEach(String string, CodePointProcedure procedure)
reverseForEachCodePoint(String, CodePointProcedure)
instead.string
in reverse order, execute the CodePointProcedure
.public static void reverseForEachCodePoint(String string, CodePointProcedure procedure)
string
in reverse order, execute the CodePointProcedure
.public static int numberOfChars(String string, int i)
public static boolean isSurrogate(String string, int i)
@Deprecated public static int count(String string, CharPredicate predicate)
predicate
.@Deprecated public static int count(String string, CharPredicate predicate)
countChar(String, CharPredicate)
instead.predicate
.public static int countChar(String string, CharPredicate predicate)
predicate
.@Deprecated public static int count(String string, CodePointPredicate predicate)
countCodePoint(String, CodePointPredicate)
instead.predicate
.public static int countCodePoint(String string, CodePointPredicate predicate)
predicate
.@Deprecated public static String collect(String string, CharFunction function)
collect(String, CharToCharFunction)
instead.@Deprecated public static String collect(String string, CharToCharFunction function)
collectChar(String, CharToCharFunction)
instead.function
.public static String collectChar(String string, CharToCharFunction function)
function
.@Deprecated public static String collect(String string, CodePointFunction function)
collectCodePoint(String, CodePointFunction)
instead.function
.public static String collectCodePoint(String string, CodePointFunction function)
function
.@Deprecated public static Character detect(String string, CharPredicate predicate)
detectChar(String, CharPredicate)
instead.predicate
.public static Character detectChar(String string, CharPredicate predicate)
predicate
.@Deprecated public static Character detectIfNone(String string, CharPredicate predicate, char resultIfNone)
detectCharIfNone(String, CharPredicate, char)
instead.predicate
. Return the default char if
no value is found.public static Character detectCharIfNone(String string, CharPredicate predicate, char resultIfNone)
predicate
. Return the default char if
no value is found.@Deprecated public static Character detectIfNone(String string, CharPredicate predicate, String resultIfNone)
detectCharIfNone(String, CharPredicate, String)
instead.predicate
. Return the first char of the
default string if no value is found.public static Character detectCharIfNone(String string, CharPredicate predicate, String resultIfNone)
predicate
. Return the first char of the
default string if no value is found.@Deprecated public static int occurrencesOf(String string, char value)
occurrencesOfChar(String, char)
instead.public static int occurrencesOfChar(String string, char value)
@Deprecated public static int occurrencesOf(String string, int value)
occurrencesOfCodePoint(String, int)
instead.public static int occurrencesOfCodePoint(String string, int value)
public static int occurrencesOf(String string, String singleCharacter)
string
.@Deprecated public static boolean anySatisfy(String string, CharPredicate predicate)
anySatisfyChar(String, CharPredicate)
instead.string
answer true for the specified predicate
.public static boolean anySatisfyChar(String string, CharPredicate predicate)
string
answer true for the specified predicate
.@Deprecated public static boolean anySatisfy(String string, CodePointPredicate predicate)
anySatisfyCodePoint(String, CodePointPredicate)
instead.string
answer true for the specified predicate
.public static boolean anySatisfyCodePoint(String string, CodePointPredicate predicate)
string
answer true for the specified predicate
.@Deprecated public static boolean allSatisfy(String string, CharPredicate predicate)
allSatisfyChar(String, CharPredicate)
instead.string
answer true for the specified predicate
.public static boolean allSatisfyChar(String string, CharPredicate predicate)
string
answer true for the specified predicate
.@Deprecated public static boolean allSatisfy(String string, CodePointPredicate predicate)
allSatisfyCodePoint(String, CodePointPredicate)
instead.string
answer true for the specified predicate
.public static boolean allSatisfyCodePoint(String string, CodePointPredicate predicate)
string
answer true for the specified predicate
.@Deprecated public static boolean noneSatisfy(String string, CharPredicate predicate)
noneSatisfyChar(String, CharPredicate)
instead.string
answer true for the specified predicate
.public static boolean noneSatisfyChar(String string, CharPredicate predicate)
string
answer true for the specified predicate
.@Deprecated public static boolean noneSatisfy(String string, CodePointPredicate predicate)
noneSatisfyCodePoint(String, CodePointPredicate)
instead.string
answer true for the specified predicate
.public static boolean noneSatisfyCodePoint(String string, CodePointPredicate predicate)
string
answer true for the specified predicate
.@Deprecated public static String select(String string, CharPredicate predicate)
selectChar(String, CharPredicate)
instead.predicate
.public static String selectChar(String string, CharPredicate predicate)
predicate
.@Deprecated public static String select(String string, CodePointPredicate predicate)
selectCodePoint(String, CodePointPredicate)
instead.predicate
.public static String selectCodePoint(String string, CodePointPredicate predicate)
predicate
.@Deprecated public static String reject(String string, CharPredicate predicate)
rejectChar(String, CharPredicate)
instead.predicate
.public static String rejectChar(String string, CharPredicate predicate)
predicate
.@Deprecated public static String reject(String string, CodePointPredicate predicate)
rejectCodePoint(String, CodePointPredicate)
instead.predicate
.public static String rejectCodePoint(String string, CodePointPredicate predicate)
predicate
.public static boolean isEmpty(String string)
public static boolean isEmptyOrWhitespace(String string)
public static boolean isNumber(String string)
public static boolean isAlphaNumeric(String string)
public static boolean notEmpty(String string)
public static boolean notEmptyOrWhitespace(String string)
public static String repeat(char c, int repeatTimes)
public static MutableList<Character> toList(String string)
public static MutableList<Character> toLowercaseList(String string)
public static MutableList<Character> toUppercaseList(String string)
public static MutableBag<Character> toBag(String string)
public static MutableBag<Character> toLowercaseBag(String string)
public static MutableBag<Character> toUppercaseBag(String string)
public static MutableSet<Character> toSet(String string)
public static MutableList<String> chunk(String string, int size)
size
- the number of characters per chunkMutableList
containing String
s of size size
, except the last will be
truncated (i.e. shorter) if the characters don't divide evenly.@Deprecated public static MutableSet<Character> asUppercaseSet(String string)
public static MutableSet<Character> toUppercaseSet(String string)
@Deprecated public static MutableSet<Character> asLowercaseSet(String string)
public static MutableSet<Character> toLowercaseSet(String string)
Copyright © 2004–2016. All rights reserved.