Subject:
|
Re: I need help on Delphi so I can finnish my program
|
Newsgroups:
|
lugnet.cad.dev
|
Date:
|
Mon, 16 Sep 2002 22:21:29 GMT
|
Viewed:
|
418 times
|
| |
| |
In lugnet.cad.dev, Orion Pobursky writes:
> This way may seem clunky but it is the only way I can think up off the yopp
> of my head:
>
> Extract each word to a TStringList class using the ExtractStrings procedure.
> For example, assuming a string called Sentence:
>
> ExtractStrings([' '], [' '], StringList, Sentence);
>
> The Nth word in the sentence is now Stringlist[N-1].
>
> Make the desired changes and then reform the string by a for statement:
>
> Sentence := '';
> for i:= 0 to StringList.Count-1 do
> Sentence := Sentence + ' ' + StringList[i];
>
> -Orion
Here's a better way (I think, I haven't tested it yet);
Use ExtractStrings as stated above and change the string you want to change.
Then set the Delimter Property to ' '
set the QuoteChar Property to ''
use the DelimitedText property to retrieve the string. The code should look
like this:
ExtractStrings([' '], [' '], StringList, Sentence);
//Manipulate the list here
StringList.Delimiter := ' ';
StringList.QuoteChar := '';
Sentence := StringList.DelimitedText;
|
|
Message is in Reply To:
| | Re: I need help on Delphi so I can finnish my program
|
| (...) This way may seem clunky but it is the only way I can think up off the yopp of my head: Extract each word to a TStringList class using the ExtractStrings procedure. For example, assuming a string called Sentence: ExtractStrings([' '], [' '], (...) (22 years ago, 15-Sep-02, to lugnet.cad.dev)
|
10 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|