basic.len Function/BASIC Program

basic.len

Command basic.len Function/BASIC Program
Applicable release versions: AP, R83
Category BASIC Program (486)
Description returns the length of a string expression.
Syntax len(string.expression)
Options
Example
customer = "john"
name.length = len(customer)
print name.length

4

string = "testt"
string = string[1,len(string)-1]
print string

test

This assignment statement uses the "len" function to delete the last 
character of "string".

string = 'abcde'
print len(string)

This outputs a 5.

a = 5
x = len(a * 10)
print x

2

This code gets the length of the result of an arithemtic expression. The result 
of the arithmetic expression is converted to an ASCII string when the 
"len" function is invoked. The output is 2, since 5 times 10 is 50, 
and the length of 50 is 2 characters.
Purpose
Related basic.statements
basic.string.expression
basic.functions