Class StringIterate
- java.lang.Object
-
- org.eclipse.collections.impl.utility.StringIterate
-
public final class StringIterate extends Object
A string is essentially an array of characters. In Smalltalk a String is a subclass of ArrayedCollection, which means it supports the Collection protocol. StringIterate implements the methods available on the collection protocol that make sense for Strings. Some methods are over-specialized, in the form of englishToUppercase() which is a fast form of uppercase, but does not work for different locales.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static boolean
allSatisfy(String string, CharPredicate predicate)
Deprecated.since 7.0.static boolean
allSatisfy(String string, CodePointPredicate predicate)
Deprecated.since 7.0.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.static boolean
anySatisfy(String string, CodePointPredicate predicate)
Deprecated.since 7.0.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.static MutableSet<Character>
asUppercaseSet(String string)
Deprecated.in 3.0.static MutableList<String>
chunk(String string, int size)
Partitions String in fixed size chunks.static String
collect(String string, CharToCharFunction function)
Deprecated.since 7.0.static String
collect(String string, CharFunction function)
Deprecated.since 3.0.static String
collect(String string, CodePointFunction function)
Deprecated.since 7.0.static String
collectChar(String string, CharToCharFunction function)
Transform the char elements to a new string using the specified functionfunction
.static String
collectCodePoint(String string, CodePointFunction function)
Transform the int code point elements to a new string using the specified functionfunction
.static int
count(String string, CharPredicate predicate)
Deprecated.since 7.0.static int
count(String string, CodePointPredicate predicate)
Deprecated.since 7.0.static int
count(String string, CharPredicate predicate)
Deprecated.since 3.0.static int
countChar(String string, CharPredicate predicate)
Count the number of elements that return true for the specifiedpredicate
.static int
countCodePoint(String string, CodePointPredicate predicate)
Count the number of elements that return true for the specifiedpredicate
.static MutableList<String>
csvTokensToList(String string)
Deprecated.in 3.0.static MutableList<String>
csvTokensToReverseSortedList(String string)
Deprecated.in 3.0.static MutableSet<String>
csvTokensToSet(String string)
Deprecated.in 3.0.static MutableList<String>
csvTokensToSortedList(String string)
Deprecated.in 3.0.static MutableList<String>
csvTrimmedTokensToList(String string)
Deprecated.in 3.0.static MutableList<String>
csvTrimmedTokensToSortedList(String string)
Deprecated.in 3.0.static Character
detect(String string, CharPredicate predicate)
Deprecated.since 7.0.static Character
detectChar(String string, CharPredicate predicate)
Find the first element that returns true for the specifiedpredicate
.static Character
detectCharIfNone(String string, CharPredicate predicate, char resultIfNone)
Find the first element that returns true for the specifiedpredicate
.static Character
detectCharIfNone(String string, CharPredicate predicate, String resultIfNone)
Find the first element that returns true for the specifiedpredicate
.static Character
detectIfNone(String string, CharPredicate predicate, char resultIfNone)
Deprecated.since 7.0.static Character
detectIfNone(String string, CharPredicate predicate, String resultIfNone)
Deprecated.since 7.0.static String
englishToLowerCase(String string)
static String
englishToUpperCase(String string)
static void
forEach(String string, CharProcedure procedure)
Deprecated.since 7.0.static void
forEach(String string, CharProcedure procedure)
Deprecated.since 3.0.static void
forEach(String string, CodePointProcedure procedure)
Deprecated.since 7.0.static void
forEachChar(String string, CharProcedure procedure)
For each char in thestring
, execute theCharProcedure
.static void
forEachCodePoint(String string, CodePointProcedure procedure)
For each int code point in thestring
, execute theCodePointProcedure
.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>
RinjectIntoTokens(String string, String separator, R injectedValue, Function2<? super R,String,? extends 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.static boolean
noneSatisfy(String string, CodePointPredicate predicate)
Deprecated.since 7.0.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.static int
occurrencesOf(String string, int value)
Deprecated.since 7.0.static int
occurrencesOf(String string, String singleCharacter)
Count the number of occurrences of the specifiedstring
.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.static String
reject(String string, CodePointPredicate predicate)
Deprecated.since 7.0.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.static void
reverseForEach(String string, CodePointProcedure procedure)
Deprecated.since 7.0.static void
reverseForEachChar(String string, CharProcedure procedure)
For each char in thestring
in reverse order, execute theCharProcedure
.static void
reverseForEachCodePoint(String string, CodePointProcedure procedure)
For each int code point in thestring
in reverse order, execute theCodePointProcedure
.static String
select(String string, CharPredicate predicate)
Deprecated.since 7.0.static String
select(String string, CodePointPredicate predicate)
Deprecated.since 7.0.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 aMutableList
.static MutableMap<String,String>
tokensToMap(String string)
Converts a string of tokens to aMutableMap
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 aMutableMap
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 aMutableMap
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 sortedMutableList
.static MutableSet<String>
tokensToSet(String string, String separator)
Converts a string of tokens to aMutableSet
.static MutableList<String>
tokensToSortedList(String string, String separator)
Converts a string of tokens separated by the specified separator to a sortedMutableList
.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 aMutableList
.static MutableList<String>
trimmedTokensToSortedList(String string, String separator)
Converts a string of tokens separated by the specified separator to a sortedMutableList
.
-
-
-
Method Detail
-
asCharAdapter
public static CharAdapter asCharAdapter(String string)
- Since:
- 7.0.
-
asCodePointAdapter
public static CodePointAdapter asCodePointAdapter(String string)
- Since:
- 7.0.
-
toCodePointList
public static CodePointList toCodePointList(String string)
- Since:
- 7.0.
-
csvTokensToSortedList
@Deprecated public 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.Converts a string of tokens separated by the specified separator to a sortedMutableList
.
-
csvTrimmedTokensToSortedList
@Deprecated public 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.Converts a string of tokens separated by the specified separator to a sortedMutableList
.
-
tokensToSortedList
public static MutableList<String> tokensToSortedList(String string, String separator)
Converts a string of tokens separated by the specified separator to a sortedMutableList
.
-
trimmedTokensToSortedList
public static MutableList<String> trimmedTokensToSortedList(String string, String separator)
Converts a string of tokens separated by the specified separator to a sortedMutableList
.
-
csvTokensToList
@Deprecated public 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.Converts a string of tokens separated by commas to aMutableList
.
-
csvTrimmedTokensToList
@Deprecated public 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.Converts a string of tokens separated by commas to aMutableList
.
-
tokensToList
public static MutableList<String> tokensToList(String string, String separator)
Converts a string of tokens separated by the specified separator to aMutableList
.
-
trimmedTokensToList
public static MutableList<String> trimmedTokensToList(String string, String separator)
Converts a string of tokens separated by the specified separator to aMutableList
.
-
csvTokensToSet
@Deprecated public 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.Converts a string of tokens separated by commas to aMutableSet
.
-
tokensToSet
public static MutableSet<String> tokensToSet(String string, String separator)
Converts a string of tokens to aMutableSet
.
-
tokensToMap
public static MutableMap<String,String> tokensToMap(String string)
Converts a string of tokens to aMutableMap
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"
-
tokensToMap
public static MutableMap<String,String> tokensToMap(String string, String pairSeparator, String keyValueSeparator)
Converts a string of tokens to aMutableMap
using the specified separators.
-
tokensToMap
public 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 aMutableMap
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]}
-
csvTokensToReverseSortedList
@Deprecated public 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.Converts a string of tokens separated by the specified separator to a reverse sortedMutableList
.
-
tokensToReverseSortedList
public static MutableList<String> tokensToReverseSortedList(String string, String separator)
Converts a string of tokens separated by the specified separator to a reverse sortedMutableList
.
-
forEachToken
public 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.
-
injectIntoTokens
public static <T,R> R injectIntoTokens(String string, String separator, R injectedValue, Function2<? super R,String,? extends R> function)
For each token in a string separated by the specified separator, execute the specified Function2, returning the result value from the function. For more information, seeIterate.injectInto(Object, Iterable, Function2)
-
forEachTrimmedToken
public static void forEachTrimmedToken(String string, String separator, Procedure<String> procedure)
-
forEach
@Deprecated public static void forEach(String string, CharProcedure procedure)
Deprecated.since 3.0. UseforEach(String, CharProcedure)
instead.For each character in thestring
, execute theCharProcedure
.
-
forEach
@Deprecated public static void forEach(String string, CharProcedure procedure)
Deprecated.since 7.0. UseforEachChar(String, CharProcedure)
instead.For each character in thestring
, execute theCharProcedure
.
-
forEachChar
public static void forEachChar(String string, CharProcedure procedure)
For each char in thestring
, execute theCharProcedure
.- Since:
- 7.0
-
forEach
@Deprecated public static void forEach(String string, CodePointProcedure procedure)
Deprecated.since 7.0. UseforEachCodePoint(String, CodePointProcedure)
instead.For each int code point in thestring
, execute theCodePointProcedure
.
-
forEachCodePoint
public static void forEachCodePoint(String string, CodePointProcedure procedure)
For each int code point in thestring
, execute theCodePointProcedure
.- Since:
- 7.0
-
reverseForEach
@Deprecated public static void reverseForEach(String string, CharProcedure procedure)
Deprecated.since 7.0. UsereverseForEachChar(String, CharProcedure)
instead.For each char in thestring
in reverse order, execute theCharProcedure
.
-
reverseForEachChar
public static void reverseForEachChar(String string, CharProcedure procedure)
For each char in thestring
in reverse order, execute theCharProcedure
.- Since:
- 7.0
-
reverseForEach
@Deprecated public static void reverseForEach(String string, CodePointProcedure procedure)
Deprecated.since 7.0. UsereverseForEachCodePoint(String, CodePointProcedure)
instead.For each int code point in thestring
in reverse order, execute theCodePointProcedure
.
-
reverseForEachCodePoint
public static void reverseForEachCodePoint(String string, CodePointProcedure procedure)
For each int code point in thestring
in reverse order, execute theCodePointProcedure
.- Since:
- 7.0
-
numberOfChars
public static int numberOfChars(String string, int i)
-
isSurrogate
public static boolean isSurrogate(String string, int i)
-
count
@Deprecated public static int count(String string, CharPredicate predicate)
Deprecated.since 3.0.Count the number of elements that return true for the specifiedpredicate
.
-
count
@Deprecated public static int count(String string, CharPredicate predicate)
Deprecated.since 7.0. UsecountChar(String, CharPredicate)
instead.Count the number of elements that return true for the specifiedpredicate
.
-
countChar
public static int countChar(String string, CharPredicate predicate)
Count the number of elements that return true for the specifiedpredicate
.- Since:
- 7.0
-
count
@Deprecated public static int count(String string, CodePointPredicate predicate)
Deprecated.since 7.0. UsecountCodePoint(String, CodePointPredicate)
instead.Count the number of elements that return true for the specifiedpredicate
.
-
countCodePoint
public static int countCodePoint(String string, CodePointPredicate predicate)
Count the number of elements that return true for the specifiedpredicate
.- Since:
- 7.0
-
collect
@Deprecated public static String collect(String string, CharFunction function)
Deprecated.since 3.0. Usecollect(String, CharToCharFunction)
instead.
-
collect
@Deprecated public static String collect(String string, CharToCharFunction function)
Deprecated.since 7.0. UsecollectChar(String, CharToCharFunction)
instead.Transform the char elements to a new string using the specified functionfunction
.
-
collectChar
public static String collectChar(String string, CharToCharFunction function)
Transform the char elements to a new string using the specified functionfunction
.- Since:
- 7.0
-
collect
@Deprecated public static String collect(String string, CodePointFunction function)
Deprecated.since 7.0. UsecollectCodePoint(String, CodePointFunction)
instead.Transform the int code point elements to a new string using the specified functionfunction
.
-
collectCodePoint
public static String collectCodePoint(String string, CodePointFunction function)
Transform the int code point elements to a new string using the specified functionfunction
.- Since:
- 7.0
-
detect
@Deprecated public static Character detect(String string, CharPredicate predicate)
Deprecated.since 7.0. UsedetectChar(String, CharPredicate)
instead.Find the first element that returns true for the specifiedpredicate
.
-
detectChar
public static Character detectChar(String string, CharPredicate predicate)
Find the first element that returns true for the specifiedpredicate
.- Since:
- 7.0
-
detectIfNone
@Deprecated public static Character detectIfNone(String string, CharPredicate predicate, char resultIfNone)
Deprecated.since 7.0. UsedetectCharIfNone(String, CharPredicate, char)
instead.Find the first element that returns true for the specifiedpredicate
. Return the default char if no value is found.
-
detectCharIfNone
public static Character detectCharIfNone(String string, CharPredicate predicate, char resultIfNone)
Find the first element that returns true for the specifiedpredicate
. Return the default char if no value is found.
-
detectIfNone
@Deprecated public static Character detectIfNone(String string, CharPredicate predicate, String resultIfNone)
Deprecated.since 7.0. UsedetectCharIfNone(String, CharPredicate, String)
instead.Find the first element that returns true for the specifiedpredicate
. Return the first char of the default string if no value is found.
-
detectCharIfNone
public static Character detectCharIfNone(String string, CharPredicate predicate, String resultIfNone)
Find the first element that returns true for the specifiedpredicate
. Return the first char of the default string if no value is found.
-
occurrencesOf
@Deprecated public static int occurrencesOf(String string, char value)
Deprecated.since 7.0. UseoccurrencesOfChar(String, char)
instead.Count the number of occurrences of the specified char.
-
occurrencesOfChar
public static int occurrencesOfChar(String string, char value)
Count the number of occurrences of the specified char.- Since:
- 7.0
-
occurrencesOf
@Deprecated public static int occurrencesOf(String string, int value)
Deprecated.since 7.0. UseoccurrencesOfCodePoint(String, int)
instead.Count the number of occurrences of the specified int code point.
-
occurrencesOfCodePoint
public static int occurrencesOfCodePoint(String string, int value)
Count the number of occurrences of the specified int code point.- Since:
- 7.0
-
occurrencesOf
public static int occurrencesOf(String string, String singleCharacter)
Count the number of occurrences of the specifiedstring
.
-
anySatisfy
@Deprecated public static boolean anySatisfy(String string, CharPredicate predicate)
Deprecated.since 7.0. UseanySatisfyChar(String, CharPredicate)
instead.- Returns:
- true if any of the characters in the
string
answer true for the specifiedpredicate
.
-
anySatisfyChar
public static boolean anySatisfyChar(String string, CharPredicate predicate)
- Returns:
- true if any of the characters in the
string
answer true for the specifiedpredicate
. - Since:
- 7.0
-
anySatisfy
@Deprecated public static boolean anySatisfy(String string, CodePointPredicate predicate)
Deprecated.since 7.0. UseanySatisfyCodePoint(String, CodePointPredicate)
instead.- Returns:
- true if any of the code points in the
string
answer true for the specifiedpredicate
.
-
anySatisfyCodePoint
public static boolean anySatisfyCodePoint(String string, CodePointPredicate predicate)
- Returns:
- true if any of the code points in the
string
answer true for the specifiedpredicate
. - Since:
- 7.0
-
allSatisfy
@Deprecated public static boolean allSatisfy(String string, CharPredicate predicate)
Deprecated.since 7.0. UseallSatisfyChar(String, CharPredicate)
instead.- Returns:
- true if all the characters in the
string
answer true for the specifiedpredicate
.
-
allSatisfyChar
public static boolean allSatisfyChar(String string, CharPredicate predicate)
- Returns:
- true if all the characters in the
string
answer true for the specifiedpredicate
. - Since:
- 7.0
-
allSatisfy
@Deprecated public static boolean allSatisfy(String string, CodePointPredicate predicate)
Deprecated.since 7.0. UseallSatisfyCodePoint(String, CodePointPredicate)
instead.- Returns:
- true if all the code points in the
string
answer true for the specifiedpredicate
.
-
allSatisfyCodePoint
public static boolean allSatisfyCodePoint(String string, CodePointPredicate predicate)
- Returns:
- true if all the code points in the
string
answer true for the specifiedpredicate
. - Since:
- 7.0
-
noneSatisfy
@Deprecated public static boolean noneSatisfy(String string, CharPredicate predicate)
Deprecated.since 7.0. UsenoneSatisfyChar(String, CharPredicate)
instead.- Returns:
- true if none of the characters in the
string
answer true for the specifiedpredicate
.
-
noneSatisfyChar
public static boolean noneSatisfyChar(String string, CharPredicate predicate)
- Returns:
- true if none of the characters in the
string
answer true for the specifiedpredicate
. - Since:
- 7.0
-
noneSatisfy
@Deprecated public static boolean noneSatisfy(String string, CodePointPredicate predicate)
Deprecated.since 7.0. UsenoneSatisfyCodePoint(String, CodePointPredicate)
instead.- Returns:
- true if none of the code points in the
string
answer true for the specifiedpredicate
.
-
noneSatisfyCodePoint
public static boolean noneSatisfyCodePoint(String string, CodePointPredicate predicate)
- Returns:
- true if none of the code points in the
string
answer true for the specifiedpredicate
. - Since:
- 7.0
-
select
@Deprecated public static String select(String string, CharPredicate predicate)
Deprecated.since 7.0. UseselectChar(String, CharPredicate)
instead.- Returns:
- a new string with all the characters that return true for the specified
predicate
.
-
selectChar
public static String selectChar(String string, CharPredicate predicate)
- Returns:
- a new string with all the characters that return true for the specified
predicate
. - Since:
- 7.0
-
select
@Deprecated public static String select(String string, CodePointPredicate predicate)
Deprecated.since 7.0. UseselectCodePoint(String, CodePointPredicate)
instead.- Returns:
- a new string with all the code points that return true for the specified
predicate
.
-
selectCodePoint
public static String selectCodePoint(String string, CodePointPredicate predicate)
- Returns:
- a new string with all the code points that return true for the specified
predicate
. - Since:
- 7.0
-
reject
@Deprecated public static String reject(String string, CharPredicate predicate)
Deprecated.since 7.0. UserejectChar(String, CharPredicate)
instead.- Returns:
- a new string excluding all the characters that return true for the specified
predicate
.
-
rejectChar
public static String rejectChar(String string, CharPredicate predicate)
- Returns:
- a new string excluding all the characters that return true for the specified
predicate
. - Since:
- 7.0
-
reject
@Deprecated public static String reject(String string, CodePointPredicate predicate)
Deprecated.since 7.0. UserejectCodePoint(String, CodePointPredicate)
instead.- Returns:
- a new string excluding all the code points that return true for the specified
predicate
.
-
rejectCodePoint
public static String rejectCodePoint(String string, CodePointPredicate predicate)
- Returns:
- a new string excluding all the code points that return true for the specified
predicate
. - Since:
- 7.0
-
isEmpty
public static boolean isEmpty(String string)
-
isEmptyOrWhitespace
public static boolean isEmptyOrWhitespace(String string)
-
isNumber
public static boolean isNumber(String string)
-
isAlphaNumeric
public static boolean isAlphaNumeric(String string)
-
notEmpty
public static boolean notEmpty(String string)
-
notEmptyOrWhitespace
public static boolean notEmptyOrWhitespace(String string)
-
repeat
public static String repeat(char c, int repeatTimes)
-
toList
public static MutableList<Character> toList(String string)
-
toLowercaseList
public static MutableList<Character> toLowercaseList(String string)
-
toUppercaseList
public static MutableList<Character> toUppercaseList(String string)
-
toBag
public static MutableBag<Character> toBag(String string)
-
toLowercaseBag
public static MutableBag<Character> toLowercaseBag(String string)
-
toUppercaseBag
public static MutableBag<Character> toUppercaseBag(String string)
-
toSet
public static MutableSet<Character> toSet(String string)
-
chunk
public static MutableList<String> chunk(String string, int size)
Partitions String in fixed size chunks.- Parameters:
size
- the number of characters per chunk- Returns:
- A
MutableList
containingString
s of sizesize
, except the last will be truncated (i.e. shorter) if the characters don't divide evenly. - Since:
- 5.2
-
asUppercaseSet
@Deprecated public static MutableSet<Character> asUppercaseSet(String string)
Deprecated.in 3.0. Inlineable.
-
toUppercaseSet
public static MutableSet<Character> toUppercaseSet(String string)
-
asLowercaseSet
@Deprecated public static MutableSet<Character> asLowercaseSet(String string)
Deprecated.in 3.0. Inlineable.
-
toLowercaseSet
public static MutableSet<Character> toLowercaseSet(String string)
-
-