Minh Phượng
New member
How do you delete a specific line in a file?
Answer
Using a Number to Delete a Line
Answer
Using a Number to Delete a Line
- Open the file in read mode.
- Read the files contents.
- Open the file in write mode.
- Use a for loop to read each line and write it to the file.
- When we reach the line we want to delete, skip it.