length

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
the length of <string>
length(<string>)
Synonymslen
Summary

Returns the number of characters in a string.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
string
Example
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
Values
NameTypeDescription
return

The length function returns a non-negative integer.

RelatedKeyword: character, characters, integer, string
Operator: begins with, ends with
Property: number
Function: offset, number
Glossary: return, non-negative
Control Structure: function
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 <a href="string_LCS_glossary.html">string</a> 

If the string is empty, its length is zero.

Tagstext processing