{{htmlmetatags>metatag-robots=() metatag-title=(LEN | ugBASIC User Manual) metatag-keywords=(ugBASIC,Commodore 64,Commodore PLUS/4,ZX Spectrum) metatag-description=(Manual page for LEN) metatag-media-og:image=(:ugbasic:logo-ugbasic-fb.png) metatag-og:title=(LEN | ugBASIC User Manual) metatag-og:description=(Manual page for LEN) }} ====== 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: * ''[[https://github.com/spotlessmind1975/ugbasic/tree/main/examples/strings_len_01.bas|strings_len_01.bas]]'' ==== 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 [[https://github.com/spotlessmind1975/ugbasic/issues/new?title=ISSUE ON LEN|open an issue]] for this keyword on GitHub. Thank you!===== POWERED BY ===== [[:ugbasic:user:index|{{ :ugbasic:user:logo-ugbasic.png?nolink&600 |}}]]