0

Hi,
I wrote a python program that counts the occurance of each alphabetic character in a string and it works fine. I tried to port it over to java but now it fails, telling me that there is no alphabetic characters at all in it.

for (int i=0;i<alphabet.length;i++)
{
	for (int q=0;i<string.length();i++)
	{
		if alphabet[i]==string.CharAt(q)
		{	
			alphcount[i]++;
		}
	}
}

Here is the algorithm, the alphabet is stored as a char array. Alphcount is an int array that has an entry corresponding to each alphabetic character.

Any ideas?
Thanks.

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by musthafa.aj
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.