public static boolean passwordConfirmed() {
    String attempt = JOptionPane.showInputDialog("Password: ");
    FileReader fstream = null;
    String password = "";
    try {
        fstream = new FileReader("pass.txt");
        BufferedReader in = new BufferedReader(fstream);
        password = in.readLine();
        password.replace("Password: ", " ");
        System.out.println(password);
    } catch (IOException e) {
        e.printStackTrace();
    }
    if (attempt.equals(password)) {
        System.out.print("True");
        return true; 
    } else System.out.println("false");
    return false;
}
Trying to remove "Password: " from the line. It gets the line "Password: " + text afterwards (Password) I want to remove the "Password: ", so all i have left is purely the text afterwards.
 
     
    