len

Determines the length of a string or binary object

len(Object) → returns numeric

Argument Reference

Object any
Required

A string or variable name

Examples
Sample code invoking the len function

To get the total length of the string or binary object

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

Expected Result: 10

For CF 11+ Lucee 4.5+

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

Expected Result: 3

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub