The length() function returns the length, in bytes, of the specified string. Note that for multiple-byte character sets, the number of bytes is not the same as the number of characters; use the charlen() function instead.

result = length (string1);
string1 Required. The string for which a length value is determined.

result is set to the length (as an integer value) of string1.

currentuser = "John Stone";
result = length (currentuser);

In this example, result is an integer with a value of 10.