algorithm - Find and Count Words in a String in Delphi? -
I have a string that contains many words
for example, "hello- Apple-banana-hello-pears " How do I reveal a specific word?
Thank you.
You can use Delphi XE.
Something like
var word: TstringDynArray; Word: string; WordCount: integer; Start Wordcount: = 0; Term: = Split string ('Hello-Sep-Banana-Hello-Peer', '-'); Words start for words if word = 'hello' then ink (wordcount); End;
Comments
Post a Comment