Mark Wickens

back to Command Reference

LEN

[All Models]

Purpose

Returns a value which represents the number of characters contained in a string.

Format

LEN      ( string )
           └─┬──┘
     String expression

Example

LEN(A$)

Parameters

string: String expression

Explanation

Returns a value which represents the number of characters contained in a string, including characters that don’t appear on the display (character codes from 00h ~ 1Fh) and spaces.

Sample Program

10  INPUT "INPUT CHARACTERS"; C$
20  PRINT "LENGTH="; LEN(C$)
30  END

Determines the length of an input string.