Navigation:  thinBasic Modules > Core > String handling >

LEN

Previous pageReturn to chapter overviewNext page

 

Description

 

Return the length of a string expression.

 

Syntax

 

n = LEN(string_expression)

 

Returns

 

Number

 

Parameters

 

Name

Type

Optional

Meaning

String_Expression

String

No

Any string expression

 

Remarks

 

LEN will always make a copy of the string expression passed as parameter.

 

Use StrPtrLEN to avoid string copy in case of big strings like in the following example:

 

'---Define a 100Mb string

Dim MyString As String = String$(100000000, chr$(0))

MSGBOX 0, "Size: " & StrPtrLEN(STRPTR(MyString))

 

Restrictions

 

See also

 

String Handling, StrPtrLen,

 

Examples