Lookup an element.
@param   str  element to find
@return  index of the first element found; -1 if nothing was found
435504
public int indexOf(String str) {
        int i;

        for (i = 0; i < size; i++) {
            if (data[i].equals(str)) {
                return i;
            }
        }
        return -1;
    }
1018651
public int findFirst(String str, String search) {
        return (str == null || search == null) ? -1 :
            str.indexOf(search);
    }
1010792
public static Parser<Void> string(String str) {
    return Patterns.string(str).toScanner(str);
  }
1295321
public Matcher getMatcher(String str) {
                Matcher m;
                if (matchers.containsKey(str)) {
                        m = matchers.get(str);
                } else {
                        m = p.matcher(str);
                        matchers.put(str, m);
                }
                return m;
        }
751297
public static int indexOf(String[] arr, String value) {
	for (int i = 0; i < arr.length; i++) {
	    if (arr[i].equals(value)) return i;
	}
	return -1;
    }
453283
@Override
	public int indexOf(int elem) {
		// Find the location to insert the object at
		int pos=binarySearch(elem);

		// Not found
		if(pos<0) return -1;

		// Found one, iterate backwards to the first one
		while(pos>0 && elementData[pos-1]==elem) pos--;
		return pos;
	}
257338
public static boolean isAllNumber(String str) {
    	boolean hasNumber = false;
		for (int i = 0; i < str.length(); i++) {
		    if (!(Character.isDigit(str.charAt(i)) || 
				str.charAt(i) == '.' || str.charAt(i) == ',' || str.charAt(i) == '%'
				|| str.charAt(i) == '$' || str.charAt(i) == '_')) {
			return false;
		    }
		    else if (Character.isDigit(str.charAt(i)))
		    	hasNumber = true;
		}
		
		if (hasNumber == true)
			return true;
		else return false;		
    }
1256015
public int
getValue(String str) {
	str = sanitize(str);
	Integer value = (Integer) strings.get(str);
	if (value != null) {
		return value.intValue();
	}
	if (prefix != null) {
		if (str.startsWith(prefix)) {
			int val = parseNumeric(str.substring(prefix.length()));
			if (val >= 0) {
				return val;
			}
		}
	}
	if (numericok) {
		return parseNumeric(str);
	}
	return -1;
}
138381
public static boolean isLetter(String str, int beginIndex, int endIndex)
    {
        for ( int i = beginIndex; i < endIndex; i++ ) {
            char chr = str.charAt(i);
            if ( ! StringUtil.isEnLetter(chr) ) {
                return false;
            }
        }

        return true;
    }
737768
public static int indexOfIgnoreCase( String text , String needle , int fromIndex )
    {
        int textLen = text.length();
        int needleLen = needle.length();
        
        if (fromIndex >= textLen) return needleLen == 0 ? textLen : -1;
        int i = fromIndex;
        if (i < 0)
        	i = 0;
        if (needleLen == 0) return i;
        
        char first = Character.toUpperCase(needle.charAt(0));
        int max = textLen - needleLen;
        
        startSearchForFirstChar:
        while (true)
        {
            // Look for first character.
            while (i <= max)
            {
                char c = Character.toUpperCase(text.charAt(i));
                if (c != first)
                    i++;
                else
                    break;
            }
            if (i > max) return -1;
            
            // Found first character, now look at the rest of the string
            int j = i + 1;
            int end = j + needleLen - 1;
            int k = 1;
            while (j < end) 
            {
                char c1 = Character.toUpperCase(text.charAt(j++));
                char c2 = Character.toUpperCase(needle.charAt(k++));
                if (c1 != c2) 
                {
                    i++;
                    // Look for str's first char again.
                    continue startSearchForFirstChar;
                }
             }
            
            return i;
        }
    }
607996
private static boolean followingCharsAre(String str, int startIndex, String nextChars) {
        return (str.indexOf(nextChars, startIndex + 1) == (startIndex + 1));
    }
1087140
private int findValue(String s) {

        for (int i = 0; i < values.size(); i++) {
            if (s.equals(values.elementAt(i))) {
                return i;
            }    // end of if (s.equals(values.elementAt(i)))
        }        // end of for (int i=0; i<values.size(); i++)

        return -1;
    }
922725
public String find(String str, String regex) {
		if (str == null || regex == null)
			return "";
		Matcher m = Pattern.compile(regex).matcher(str);
		if (m.find()) {
			return m.group();
		} else
			return "";
	}
1122736
public int lookupIndex(short value) {
        for (int i=0; i<elements.length; i++) {
            if (elements[i] == value) {
                return i;
            }
        }
        return -1;
    }
1101541
public static String ucFirst(String str) {
	if (str == null) return null;
	else if (str.length() <= 1) return str.toUpperCase();
	else {
	    return str.substring(0, 1).toUpperCase() + str.substring(1);
	}
    }
1274852
public static int indexOf(String ele, String[] arr)
    {
        if ( arr == null ) {
            return -1;
        }
        
        for ( int i = 0; i < arr.length; i++ ) {
            if ( arr[i].equals(ele) ) {
                return i;
            }
        }
        
        return -1;
    }
575530
public static int countPuncs(String str) {
		int count = 0;
	    
		for (int i = 0; i < str.length(); i++) {
		    if (str.charAt(i) == '.' || str.charAt(i) == '?' || str.charAt(i) == '!' ||
				str.charAt(i) == ',' || str.charAt(i) == ':' || str.charAt(i) == ';') {
			count++;
		    }
		}
		
		return count;
    }