' GREETING.BAS
' This program demonstrates the LTRIM$ and RTRIM$ functions.

DIM firstName AS STRING * 12  ' declare fixed-length strings
DIM lastName AS STRING * 15

CLS
                              ' get first and last names
INPUT "Enter your first name:  ", firstName
INPUT "Enter your last name:  ", lastName

PRINT                         ' print greeting without trimming
PRINT "Nice to meet you, "; firstName; " "; lastName; "!"
                              ' print compliment with trimming
PRINT "I think "; LTRIM$(RTRIM$(firstName)); " ";
PRINT LTRIM$(RTRIM$(lastName)); " has a nice ring to it."

