Author: Jonas Bilinkevicius
How to find a word in an Array of String
Answer:
1 { ... }2 const3 StringsToSearch: array[0..7] ofstring = ('hello', 'earth', 'why', 'this', '12',
4 'people', 'how', 'what');
5 var6 Found: Boolean;
7 i: Integer;
8 begin9 Found := False;
10 for i := 0 to 7 do11 if Pos(StringsToSearch[i], ALongLongLongString) > 0 then12 begin13 Found := True;
14 break;
15 end;
16 if Found then17 ShowMessage('At least one word was found')
18 else19 ShowMessage('No words found');
20 end;