Clear letters in matrices if they are equal

Hey,

like the tittle said i need to delete the letters if they are equals in the matrice.

For example:
i had these auuua and i need to delete the three u’s and just stay with a a.

If you can give me some help over here.
My matrice is the type of String[][] matriz = new String[11][6];

Thanks

Looks like homework.

Show us your own attempts first.

This is about a game and if they are equals they eliminate the letters, i’m not good at it so i made something like that

 public void eliminateEquals() {
        Object aux = "";
        Object aux1 = "";
        Object aux2 = "";
        for (int i = 0; i < 10; i++) {
            for (int u = 0; u < 5; u++) {
                if (aux == aux1 == aux2) {
                }
            }
        }
    }

I know that it’s not good but i can’t remember anything more … just need it to finish my game

I’m not sure how to put this … but that code just doesn’t make any sense, period. What you need in order to finish your game or even to get started on it is to strengthen your knowledge of the fundamentals of Java, perhaps by going through the tutorials at http://docs.oracle.com/javase/tutorial/

Right, i know i have this other code here, but this is for arrays, not matrice …

public void eliminaIguais() {
            for (int x = 0; x < matriz.length - 3; x++) {
                    if (matriz[x] == matriz[x + 1] && matriz[x] == matriz[x + 2] && matriz[x] == matriz[x + 3]) 
                    }
                            }
                    }

If I have to solve your first post problem, my pseudo would be like this


public void eliminate(String m, char f){
m.replace(f, " ");
}

If you are comparing strings, you should use .equals() method, not == for comparisons.