Whatever message this page gives is out now! Go check it out!

StringSome

Last update:
May 18, 2026

Description

This function calls a given closure/function with every element in a given string and returns true, if one of the closure calls returns true.

Returns

Boolean

Category

Syntax

StringSome(inputString, callback)

History

ColdFusion (2021 release): Added in this release.

Parameters

Parameter
Description
inputString
(Required) The string to iterate.
callback
(Optional) Function that encapsulates the criteria.

Example

<cfscript> 
    myString="123456789"; 
    callback=function(num){ 
        return num>53 
    } 
    writeOutput(StringSome(myString,callback)) // YES 
</cfscript>

Example 2

<cfscript> 
    myString="Hello" 
    // define callback 
    callback=x=>x >= 'a' 
    writeOutput(StringSome(myString,callback)) // YES 
    // define another callback 
    callback_1=x=>x >= 'z' 
    writeOutput(StringSome(myString,callback_1)) // NO 
</cfscript>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page