string.length

Syntax string.length (string)

Params string is the string whose length you wish to determine.

Action Counts the number of characters in string.

Returns Number indicating how many characters are in string.

Examples string.length ("Where's my coffee?")

   » 18

string.length (1.5)

   » 3

In this example, the floating point number 1.5 is coerced to a string containing the three characters '1', '.', and '5'.

Notes The sizeOf verb also returns the length of a string. However, string.length coerces its parameter to be a string, while sizeOf yields different results for different value types.

See Also sizeOf

string.countWords

Discuss