Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

manipulating strings

Status
Not open for further replies.

INDO

Programmer
Mar 18, 2001
12
US
I am trying to write what i guess should be a simple program where i enter a string which may have spaces at the beginning and elsewhere and i have to print out the string with one word per line and no spaces. The basic part of the code I have so far is:


Line = ReadStringPr("Enter a line of text: ");
for(Index = 0; Index <= Length(Line); Index = Index + 1)
if(Line[Index] != '')
WriteStringCr(Line);

Could anybody please give a newbie some pointers?

many thanks


 
if(Line[Index] != ' ') //'' is not the same with ' '
//instead of ' ' you can also write 32,
//the number of the space symbol.
WriteStringCr(Line);
else
// only go to new line, it deppends on implementation John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top