LEN Function

Returns the length of a string.

Category: String
Returned data type: Integer

Syntax

LEN(source)

Required Argument

source

specifies a string for which the length needs to be determined; this can be specified as string constant, field name, or expression.

Note The length of an empty string ("") is zero. If source is NULL, the function returns a NULL value.
Tip To remove leading and trailing blanks, use the trim function.

Example

string(30) source
source = "abcdefg"
length_string = len(source) // outputs 7
 
source = " abcdefg "
length_string = len(source) // outputs 11
 
source = " " // source contains a blank
length_string = len(source) // outputs 1