I need to find out how many time one word appears in the string, but the catch is that the word you need to find can have spaces in between, for example you want to see how
You could check the array twice, on the first run trough it remove all spaces. On the second one use a compare function like this(x is the array in which you search, y is the sub-string you are searching for and i is the current element you are checking):
function compare(var x,y:myarray; i:integer):boolean;
var l:integer;
Begin
compare:=false;
for l:=1 to length(y) do Begin
if x[i+l] <> y[l] then Exit;
End;
compare:=true;
End;
on each element of your array.