Search code examples
visual-studio-codenotepad++sublimetext3

How to remove array index from file using vs code


I have one situation there I need to remove the array index from file

[0] => https://demo.com/alabama/18-wheeler-towing
[1] => https://demo.com/alabama
[2] => https://demo.com/alabama/winston-county/18-wheeler-towing
[3] => https://demo.com/alabama/winston-county
[4] => https://demo.com/service/18-wheeler-towing-addison-al
[5] => https://demo.com/alabama/winston-county/addison

I have a file there there thousands of link but I need something like

https://demo.com/alabama/18-wheeler-towing
https://demo.com/alabama
https://demo.com/alabama/winston-county/18-wheeler-towing
https://demo.com/alabama/winston-county
https://demo.com/service/18-wheeler-towing-addison-al
https://demo.com/alabama/winston-county/addison

How can I remove this array index using any file editor like vs code


Solution

  • On Visual Studio Code you may use the multi cursor, add as many cursors you want in either direction and delete the indexes by pressing the backspace or delete key.

    VS Code supports multiple cursors for fast simultaneous edits. You can add secondary cursors (rendered thinner) with Alt+Click. Each cursor operates independently based on the context it sits in. A common way to add more cursors is with Ctrl+Alt+Down or Ctrl+Alt+Up that insert cursors below or above

    GIF outlining how one may use the multicursor on VScode