strlen(X)

Returns the number of characters in a given string.

Syntax

strlen(X)
bstrlen(X)

Input

Argument Type Description
X text A scalar value or the name of a column

Return Value

Returns an integer value corresponding to the number of characters in the string X.

If X is N/A, the result is 0.

Sample Usage

value strlen(value)
'banana' 6
'' 0

Additional Information

  • strlen is Unicode (UTF-8) compliant and will work with Unicode or plain ASCII text fields.
  • If passed a string argument that is not legal Unicode, it will by default signal an error (configurable as a user preference).
  • A corresponding function bstrlen can be used with non-Unicode strings (e.g. binary or legacy encodings).
  • Equivalent to strcount(X;'').