I would like to know how to compare the chars of the strings to know how many chars coincide regardless of their position. I'm doing this but it's out of my hands, I do not get the length I should.
/* Panel mostrará los caracteres de "frase" que coincidan con
"intentos". Los que no coincidan los mostrará con un guion:"-" */
String panel = "";
String intentos = "String intentos";
String frase = "Esto es una frase";
for (int i = 0; i < frase.length(); i++)
{
for (int j = 0; j < frase.length(); j++)
{
if (j!=i && intentos.charAt(j) == frase.charAt(i))
{
panel+=frase.charAt(i);
}
else
{
panel+="-";
}
}
}