I have a String Array with multiple entries in it. I want to transcribe this String Array into another one, replacing specific entries with a digit (k in this case).
What I've tried so far:
public void replace(String[] eqh, char var, int maxX){
String[] holder = new String[eqh.length];
String comp = "";
for (int k = -maxX/2; k <= maxX/2; k++){
for (int i = 0; i< eqh.length; i++){
if (eqh[i].equals(var)){
holder[i] = ""+k;
} else {
holder[i] = eqh[i];
}
comp = Arrays.toString(holder);
System.out.println("comp: "+comp);
}
/// some stuff with comp here
}
Unfourtunatley this is not working, the return for comp is exactly the same as the input from eqh.
holder(a variable that exists only inreplace's scope), I don't see howeqhis affected.