Commodore‎ > ‎BASIC‎ > ‎Keywords‎ > ‎

LEN

RIGHT$Keyword Abbreviation Token (hex) Version(s) Classification
LEN none C3 1.0+ Function

  Syntax  
LEN string )
 
Parameters Type Legal Value(s) Default Value Note(s)
string String
any
 
Returns Type Value(s) Note(s)
number Integer
0 to 255
 
  Purpose  
Returns the number of characters in a text string.

 
  Remarks  
The LEN function simply returns the number of characters in the given string. Useful for testing or manipulating strings.
 
TYPE MISMATCH ERROR is generated if a numeric expression or variable is supplied as a "string".
  
Examples:
PRINT LEN("")
 0
 
READY.
PRINT LEN("65")
 2
 
READY.
PRINT LEN(65)

?TYPE MISMATCH ERROR
READY.
PRINT LEN(STR$(65))
 3

READY.
PRINT LEN(CHR$(65))
 1

READY.
PRINT LEN(HEX$(65))
 4

READY.
 
  Compare With  
 
  Contrast With  
 
  See Also  

© H2Obsession, 2014
Comments