0

For instance:

line 1
line 2
line 3

When I delete line 2, I want my code to automatically look like below:

line 1
line 3

Note: I am a macOS user.

Note 2: It is M-file.

  • "A line of code" -- so you want to edit an M-file on disk? Or are we talking about a string in memory, or text stored in some other way? Please be explicit. – Cris Luengo Nov 18 '21 at 23:20
  • It is 'M-file on disk'. – Pelin Özsezer Nov 19 '21 at 00:09
  • Have you considered to use regexp? [e.g. this example](https://stackoverflow.com/questions/1573361/how-do-i-find-and-remove-duplicate-lines-from-a-file-using-regular-expressions) which you should be able to extend to your problem. – Irreducible Nov 19 '21 at 10:49

0 Answers0