Previous Topic: Left - Return the Leftmost n Characters from the StringNext Topic: Mid - Return a Substring from a String


Len - Obtain the Length of the String

Valid on NetWare, Symbian OS, UNIX, Windows and Windows CE

The Len function obtains the length of the string str.

Function format:

Len(str as String) as Integer
str

Identifies the specified string.

This function returns the number of characters in the string str.

Example:

This example shows how the string operations work.

Dim text As String
Text="Unicenter TNG"

Print("Left(text,3) : " + Left(text,3))  'Uni
Print("Mid(text,4,6) : " + Mid(text,4,6)) 'center
Print("Right(text,3) : " + Right(text,3)) 'TNG
Print("Length    : " + Str(Len(text))) '13