Returns the length of a string.
Category: | String |
Returned data type: | Integer |
LEN(source)
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.
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
function nvlString
return string len
//!params string inval string defaultVal
if isnull(parameter(1)) then return parameter(2)
else return parameter(1)
end function