Skip to main content

length

Type​

function

Summary​

Returns the number of characters in a string.

Syntax​

the length of <string>
length(<string>)

Description​

Use the length function to find out how many characters are in a string, in order to process each character.

The length of a string is the number of characters in the string. The expression the length of string is equivalent to

    the number of chars in string 

If the string is empty, its length is zero.

Parameters​

NameTypeDescription

string

string

Examples​

the length of "ABC" -- returns 3
repeat with x = 1 to the length of receivedData
put char (length(it) - 3) to (length(it)) of it into myExtension

Value​

NameTypeDescription

return

The length function returns a non-negative integer.

control structure: function

function: offset, number

glossary: return, non-negative

keyword: character, characters, integer, string

operator: begins with, ends with

property: number

Compatibility and Support​

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?