Table of Contents

strlen

Description

Get the length of a string in characters.

Function prototype

int strlen <string:str>

Arguments

Name Type Comment
str string A string, the length of which is to be determined.

Return value

An integer containing the length of str, in characters.

Example

// create a new integer
int i

// set integer value to be length of a string using strlen
set i <zs:strlen "This text is 31 characters long">

// echo result to event log
echo i

… the output of which is written to the event log by echo as:

31

Comments

None.

See also