Method
Len
Warning
This item was deprecated in version 2019r2. Please use String.Length as a replacement.
Description
Returns the number of characters in the specified string.
Usage
result = Len(source)
OR
result = sourceVariable.Len
Part |
Type |
Description |
---|---|---|
result |
The number of characters in string. |
|
source |
Any valid string expression. |
|
sourceVariable |
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.
Sample code
This example uses the Len function to return the number of characters in a string.
Var n As Integer
n = Len("Hello world") ' returns 11
Var s As String
s = "Hello World"
n = s.Len ' returns 11
Compatibility
All project types on all supported operating systems.
See also
Asc, Chr, String.IndexOf, String.Bytes, String.Middle, String.Right functions.