<< Prev        Next >>

ID : 281

Len

Function

Return the number of characters of a specified string.

Syntax

Len(string)

Guaranteed entry

String
Designate String Type data.

Return value

Return the number of characters by Integer Type data.

Description

The number of characters of a specified string is returned.

Related Terms

Asc, Chr, SprintF, Left, Mid, Right, Val, InStr, Bin

Attention

In addition to a single-byte character, a double-byte character is regarded as one character as well. To obtain the number of byte the string, use LenB.

Example

'!TITLE "Obtain the number of characters the string"
' Acquiring a string length of a string "abcdefg"
Sub Sample_Len

  Dim aaa As Integer

  'Assign a string length of a string "abcdefg" to aaa
  aaa = Len( "abcdefg" )

  ' Display "7" on the message output window
  PrintDbg aaa

End Sub

ID : 281

<< Prev        Next >>