PDA

View Full Version : pls help in doing this program that counts the


Tezer
06-23-2008, 02:01 AM
numbers of words in a long sting? ok
i thing we must use arrays concept pls help i geting it

Damitha Kaushalya
06-23-2008, 08:01 AM
count the number of Spaces "" in the string

we can help more if u tel what u have done

this is in Delphi
if u got your question right this works

Function Count (S : String): integer;
var
i,n : integer;
begin
if s = '' then
begin
result := 0;
exit;
end;
n := 0;
for I := 1 to length(s) do if s[i] = '' then inc(n);
result := n+1;
end;

fyiguoh
06-23-2008, 08:59 AM
Internet for Technology News-
http://livearticle.net/