User Tools

Site Tools


ugbasic:user:kw:len
Translations of this page:


ugBASIC User Manual

LEN ✓

SYNTAX

   = LEN( text )

PURPOSE

the LEN command (short for “length”) is used to determine the length of a string, or the total number of characters in the string. This is a very useful command when you need to know the size of a string to perform manipulation or comparison operations.

You can check whether a string exceeds a certain maximum length or not. You can use LEN to create strings of a fixed length by adding spaces or other characters. You can combine LEN with other functions such as LEFT$, RIGHT$, and MID$ to extract and modify parts of a string. You can compare the length of two strings to make decisions in your program.

EXAMPLE

  x = LEN( "TEST" )

See also the following example files:

AVAILABLE ON

ANY PROBLEM?

If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please open an issue for this keyword on GitHub. Thank you!

POWERED BY