String.Length

From Xojo Documentation

Revision as of 13:46, 4 July 2019 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Method

Returns the number of characters in the specified string.

Syntax

result=stringVariable.Length

Part Type Description
result Integer The number of characters in string.
stringVariable String Any variable of type String.

Notes

If you need the number of bytes in the string rather than the number of characters, use the String.Bytes function.

Examples

This example uses the Length function to return the number of characters in a string.

Var s As String
s = "Hello World"
n = s.Length // returns 11

See Also

String for a complete list of functions.