len()

Read(857) Label: compute, string,

Description:

Compute the length of a string.

Syntax:

len(s,cs)

Note:

The function computes the number of bytes in string s. When parameter cs, the character set, is absent, it gets the number of characters in the string and automatically uses charset GB2312.

Parameter:

s

A string.

cs

Charset; can be omitted.

Return value:

Integer

Example:

len("esproc")

6

len(" esproc ")

8

len("esproc",)

6

len("集算器",)

6; use charset GB2312 as the charset parameter is absent

len("esproc","UTF-8")

6