I currently have a list called regkey and a string called line_to_delete, which I obviously want to delete from the list. At the moment I'm searching through one element of the list at a time creating substrings as line_to_delete only represents part of the line that I want to delete but is uniquely identifiable within the list.
Anyway what I really need to do is make this more efficient, use fewer resources and be quicker, so are there any ways to do this?
To get to search home even faster, you can use the keyboard shortcut Windows logo key + S to open Search, or simply mouse hover on the illustration in the search box on the taskbar.
The reason for this is because your laptop typically has many files, and the more files there are to index, the longer it takes to complete the process. So, it makes sense to tell Windows to limit indexing only to specific locations. For instance, you can exclude certain directories or folders.
Use the Taskbar Search Bar for a General Search Press the WIN key, or select the search bar from the bottom-left corner of the taskbar, near the Start button. Start typing the name of the file, app, or another item you're looking for, but don't press Enter just yet. The results appear instantly.
To open the Find pane from the Edit View, press Ctrl+F, or click Home > Find. Find text by typing it in the Search the document for…
Use lamba expressions if it's a List<string>
:
list.RemoveAll(x => x.Contains(line_to_delete));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With