Weekly Qbasic and Qb64 Lesson Topics
April 19, 2024, 01:02:46 am
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Want to see a specific Tutorial? ASK!
 
  Home Help Search Arcade Links Staff List Login Register  

New Text Challenge

Pages: [1]
  Print  
Author Topic: New Text Challenge  (Read 1813 times)
SMcNeill
Newbie
*
Posts: 3


« on: November 24, 2012, 12:17:45 am »

An easy solution to this one:

Code:
DIM sentence AS STRING, word AS STRING
PRINT "Give me a sentence: ";
INPUT sentence
sentence = sentence + " "
DO
    wordpos = INSTR(sentence, " ")
    word = LEFT$(sentence, wordpos - 1)
    sentence = RIGHT$(sentence, LEN(sentence) - wordpos)
    PRINT word
LOOP UNTIL wordpos = 0
« Last Edit: November 24, 2012, 12:20:07 am by SMcNeill » Report Spam   Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum


Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy