this is in java
public void deleteUser(String username) {
File f1 = new File("index.txt");
Scanner f1reader = new Scanner(f1);
String.replaceAll(username, "");
}
The above code is intended to delete a username from a .txt file named index based on the input to the function however I receive the following error on the replaceAll line.
Cannot make a static reference to the non-static method replaceAll(String, String) from the type String