public class StringUtil extends Object
Constructor and Description |
---|
StringUtil() |
Modifier and Type | Method and Description |
---|---|
static <T extends Collection<? super String>> |
copyPartialMatches(String token,
Iterable<String> originals,
T collection)
Copies all elements from the iterable collection of originals to the
collection provided.
|
static boolean |
startsWithIgnoreCase(String string,
String prefix)
This method uses a region to check case-insensitive equality.
|
public static <T extends Collection<? super String>> T copyPartialMatches(String token, Iterable<String> originals, T collection) throws UnsupportedOperationException, IllegalArgumentException
T
- the collection of stringstoken
- String to search fororiginals
- An iterable collection of strings to filter.collection
- The collection to add matches toUnsupportedOperationException
- if the collection is immutable
and originals contains a string which starts with the specified
search string.IllegalArgumentException
- if any parameter is is nullIllegalArgumentException
- if originals contains a null element.
Note: the collection may be modified before this is thrownpublic static boolean startsWithIgnoreCase(String string, String prefix) throws IllegalArgumentException, NullPointerException
string
- String to checkprefix
- Prefix of string to compareNullPointerException
- if prefix is nullIllegalArgumentException
- if string is nullCopyright © 2017. All rights reserved.