Why .substring() does not work well in my java proyect? : I'm trying to erase a row from a csv file with this function:

    public void borrarAlumno(String id) throws IOException {
	
		BufferedReader br = new BufferedReader(new FileReader(archivo));
		StringBuffer sb = new StringBuffer("");
		String line;
		while ((line = br.readLine()) != null) {
			System.out.println(line.substring((5)));
			if(line != " " && line != null){
				if(!line.substring(0, 6).equals(id)){
					sb.append(line);
				}
			}
		}
		br.close();
		FileWriter fw = new FileWriter(new File(archivo));
		fw.write(sb.toString());
		fw.close();

		
	}

But i get this error:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -5
	at java.lang.String.substring(Unknown Source

The firt line of the file is : Matricula,Nombre,Apellido
i.e. it has something i dont get why the IndexOutOfBounds problem

Help me please,