src/org/ohmage/util/StringUtils.java
public static boolean lengthWithinLimits(String string, int min, int max) {
		if(string == null) {
			return false;
		}
		
		if(min > max) {
			return false;
		}
		
		int stringLength = string.length();
		return((stringLength >= min) && (stringLength <= max));
	}
/**
	 * Checks if a String's length is greater than or equal to some 'min' 
	 * value, and less than or equal to some 'max' value. The String should not
	 * be null, but if it is, false is returned.
	 * 
	 * @param string The String value whose length is being checked.
	 * 
	 * @param min The minimum allowed value for the String.
	 * 
	 * @param max The maximum allowed value for the String.
	 * 
	 * @return Returns false if the String is null, 'min' is greater than 
	 * 		   'max', or if the String's length is not within the bounds; 
	 * 		   otherwise, true is returned.
	 */


@param string The String value whose length is being checked.

@param min The minimum allowed value for the String.

@param max The maximum allowed value for the String.


@param string The String value whose length is being checked . @param min The minimum allowed value for the String . @param max The maximum allowed value for the String .
public static boolean lengthWithinLimits(String string, int min, int max) {
		if(string == null) {
			return false;
		}
		if(min > max) {
			return false;
		}
		int stringLength = string.length();
		return((stringLength >= min) && (stringLength <= max));
	}
public static boolean lengthWithinLimits ( String string , int min , int max ) { if ( string == null ) { return false ; } if ( min > max ) { return false ; } int stringLength = string . length ( ) ; return ( ( stringLength >= min ) && ( stringLength <= max ) ) ; }
Checks if a String's length is greater than or equal to some 'min'
 value, and less than or equal to some 'max' value.
Checks if a String ' s length is greater than or equal to some ' min ' value and less than or equal to some ' max ' value .