LENGTH

From STX Wiki
< Programmer Guide‎ | Command Reference
Revision as of 11:17, 4 March 2016 by Jw (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The LENGTH command returns the length in characters of its first argument:

var := LENGTH string

Note that any surplus arguments are ignored. See LINELENGTH for an alternative command retrieving the length of all arguments, including argument delimiters (e.g. whitespace).

// returns 1 - the first argument is "a"
#a := length a b c

// returns 5 - due to quoting, the first argument now is "a b c"
#a := length 'a b c'

// returns 6 - under quotes, every whitespace character counts
#a := length 'a  b c'

Navigation menu

Personal tools