I would like to replace a char in a string. My idea was this:
public Puzzle replace(String letter, int digit)
{
String str = letter;
String d = ""+digit;
String nStr = str.replace(letter,d);
Puzzle newPuzzle = new Puzzle(nStr, d, str);
return newPuzzle;
// ...
}
but the replacing happens only if the "String str = letter"(letter) but it should be something like "String str = string"(string), Example => A2B+1A1=AAC would become 32B+131=33C this would be the outcome if I replace the letter 'A' by '3' in the string, and this would repeat until all the letters change to an int and the sum of string1+string2=result. Any help in appreciated. Thank you
string1+string2=result.Anton'sanswer.