len

Determines the length of a string or binary object

len(Object) → returns Numeric

len Argument Reference

Object
Required

A string or variable name

Examples sample code invoking the len function


Simple example for Len function

To get the total length of the string or binary object

someString = 'ColdFusion';
writeOutput(len(someString));

Expected Result: 10


Simple example for Len function as member function

For CF 11+ Lucee 4.5+

colorArray = ['Green','red','blue'];
writeOutput(colorArray.len());

Expected Result: 3


Fork me on GitHub