len()
Purpose
Find the length of a string or array
Description
Returns the number of characters in a text string or the number of items in an array
Syntax
stringlen = len( string )
arraylen = len( array )
Arguments
string string to find the lenght of
array array to find the length of
stringlen number of characters in the specified string
arraylen number of entries in the specified array
Example
// Show the length of a string
s = "Hello World"
printAt( 0, 0, "Length of ", s, " is ", len( s ) )
// Show the length of an array
a = []
a[9] = s
printAt( 0, 1, "Length of a is ", len( a ) )
update()
sleep( 3 )
Associated Commands
cursor(), drawText(), ink(), print(), printAt(), stringHash(), textSize(), tHeight(), tWidth()