Delphi String Handling (Removing spaces)

Posted by Nokoff on June 19, 2006

Hi there, I am currently trying to figure out how to correct an error in a program I currently have. The program's function is to count the number of words in a string.

Here is the program code as I have it here:

Currently, TForm1.Button1Click correctly displays the amount of words by counting the amount of spaces and adding one to that counter HOWEVER, does not function correctly if there is more than one space between the words or at teh beginning of the sentence. Is there any snippet of code i can whip in here to correct this?

Thank you very much

Related Articles and Replies