CFLib.org – Common Function Library Project

listFindOneOf(list, values[, delimiters])

Last updated August 5, 2005

author

Sam Curren

Version: 1 | Requires: CF6 | Library: StrLib

Description:
returns true if one of the values in the values list is found in the list.

Return Values:
Returns a boolean.

Example:

<cfoutput>
True: #ListFindOneOf("a.b.c", "f.b", ".")#<br/>
False: #ListFindOneOf("a.b.c", "d.f", ".")#<br/>
</cfoutput>

Parameters:

Name Description Required
list List of to search. Yes
values List of values to search for. Yes
delimiters List delimiter. Defaults to a comma. No

Full UDF Source:

<!---
 returns true if one of the values in the values list is found in the list.
 
 @param list 	 List of to search. (Required)
 @param values 	 List of values to search for. (Required)
 @param delimiters 	 List delimiter. Defaults to a comma. (Optional)
 @return Returns a boolean. 
 @author Sam Curren (telegramsam@byu.edu) 
 @version 1, August 5, 2005 
--->
<cffunction name="listFindOneOf" output="false" returntype="boolean">
	<cfargument name="list" type="string" required="yes"/>
	<cfargument name="values" type="string" required="yes"/>
	<cfargument name="delimiters" type="string" required="no" default=","/>
	<cfset var value = 0/>
	<cfloop list="#arguments.values#" index="value" delimiters="#arguments.delimiters#">
		<cfif ListFind(arguments.list, value, arguments.delimiters)>
			<cfreturn true />
		</cfif>
	</cfloop>
	<cfreturn false />
</cffunction>
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson