Android Utililty Methods String Array Search

List of utility methods to do String Array Search

Description

The list of methods to do String Array Search are organized into topic(s).

Method

intindexOf(String[] datas, String val)
index Of
if (val != null) {
    for (int i = 0; i < datas.length; i++) {
        if (datas[i].equals(val)) {
            return i;
return -1;
...
intindexOf(String[] datas, String val)
index Of
if (val != null && datas != null) {
    for (int i = 0; i < datas.length; i++) {
        if (datas[i] != null && datas[i].equals(val)) {
            return i;
return -1;
...
booleanin(String needle, String... haystack)
in
for (String hay : haystack) {
    if (hay.equals(needle))
        return true;
return false;
booleancontainsOnlyAlphaDigitHyphen( final Collection values)
contains Only Alpha Digit Hyphen
if (values == null) {
    return true;
final int upperAlphabetFirst = 0x41; 
final int upperAlphabetAfterLast = 0x5b; 
final int lowerAlphabetFirst = 0x61; 
final int lowerAlphabetAfterLast = 0x7b; 
final int digitFirst = 0x30; 
...
booleancontainsOnlyWhiteSpaces( final Collection values)
contains Only White Spaces
if (values == null) {
    return true;
for (final String str : values) {
    if (TextUtils.isEmpty(str)) {
        continue;
    final int length = str.length();
...