I am trying to remove the non-number characters from my string.
I have tried using the .replace() method but this returns with the error:
The method replace(char, char) in the type String is not applicable for the arguments (String, String)
Code:
Properties p = new Properties();
File f = new File("coords.txt");
if (f.exists()) {
    FileInputStream in;
    try {
        in = new FileInputStream(f);
        p.load(in);
        in.close();
    } catch (Exception e) {
        System.err.println("Failed to load coordinates");
        System.err.println(e.getMessage());
        Button.waitForAnyPress();
        System.exit(0);
    }
} else {
    System.out.println("No coordinates found");
    while (!Button.ESCAPE.isPressed()) {
        Thread.yield();
    }
    System.exit(0);
}
When I print out the string gg, initialized like:
String gg = p.toString();
I get the output: Object020f458.  
My computer highlights the error on the replace:
gg = gg.replace("{", "");
gg = gg.replace("=", "");
gg = gg.replace("}", "");
int commaLoc = gg.indexOf(",");
int x = Integer.parseInt(gg.substring(0,commaLoc));
int y = Integer.parseInt(gg.substring(commaLoc + 1));
 
     
    
 
     
     
    