'----------------------------------------------------------------------- ' STRING2.BAS ' ' CIS 120 Lecture Notes example ' Mike Huffman ' Portland Community College, Computer Information Systems ' ' Last update: 08 MAY 2002 '----------------------------------------------------------------------- CLS name$ = "John Paul Jones" i% = 1 DO WHILE i% < LEN(name$) ch$ = MID$(name$, i%, 1) ' get character at index i IF ch$ = " " THEN EXIT DO ' look for first space first$ = first$ + ch$ ' build first name from characters i% = i% + 1 ' increment loop counter LOOP PRINT first$ ' display the first name