<!-- global_list_tools -->
<!--

/**
 * Check if a string is contained in an array of strings.
 *
 * @param array Array of strings.
 * @param str The string to be searched.
 * @param trim If true, each value in the array is trimmed before comparing it to str.
 * @param ignoreCase True, to ignore case when comparing the strings.
 * @return True, if str is contained in array.
 */ 
function LIST_arrayContainsString(array, str, trim, ignoreCase)
{
	var index = LIST_indexOfString(array, str, trim, ignoreCase);
	return (index != -1);
}

/**
 * Get the index of a string in an array of strings.
 *
 * @param array Array of strings.
 * @param str The string to be searched.
 * @param trim If true, each value in the array is trimmed before comparing it to str.
 * @param ignoreCase True to ignore case when comparing the strings.
 * @return Index of str in array, or -1, if str is not contained in array.
 */ 
function LIST_indexOfString(array, str, trim, ignoreCase)
{
  var value;
	for (var i=0; i<array.length; i++)
	{
		value = array[i];
		if (trim)
		{
			value = STR_trim(value);
		}
		if (STR_equals(value, str, ignoreCase))
		{
			return i;
		}
	}
	return -1;
}

-->
