number of repeated characters in string array
843789Jul 14 2010 — edited Jul 15 2010Hi,
I m trying to get number of repeated characters in string array. I couldnt figure out where am i doing mistake.
thank you,
For example: count({"alpha, beta,"}, 'a')
a is repeated 3
l is repeated 1 etc.
public class Test
{
public static int count(String[] stringArray, char c)
{
public String [] str = new String [2];
int count = 0;
str[0]
str[1]
for(int i = 0; i<str.length(); i++)
if (str.charAt(i)
count++;
return count;