3

If I made the same mistake several times in the same code. Is it possible for me to change all the mistakes at once rather than finding each mistake and correcting it.

For Ex:- If I have written prnt instead of print several times at different places can I change it at once and apply it for all others rather than going at each place and correcting it manually.

Varun Moghe
  • 74
  • 2
  • 3
  • 12
  • 1
    ctrl + h (find and replace) => entire solution => apply all – scniro Jan 11 '15 at 04:25
  • Does this answer your question? [Select all occurrences of selected word in VSCode](https://stackoverflow.com/questions/46539714/select-all-occurrences-of-selected-word-in-vscode) – Rikki Jul 02 '22 at 00:37

4 Answers4

9

You can use the Find and Replace feature in Visual Studio to find prnt and replace it with print. Use Ctrl+Shift+H as a quick shortcut to find and replace.

ahmed.eltawil
  • 561
  • 4
  • 16
6

visual studio support multiple edit.

You can use Shift+ALT+; to edit all the same words in current file.

For this blog: Visual Studio Tips and tricks: Multi-line and multi-cursor editing you can get more infomation.

我零0七
  • 315
  • 3
  • 6
0

You can also change it in for the whole solution. Use Ctrl+Shift+H on visual studio set the word you want to replace, type in the new word to be replaced, set whether it should be replaced for the entire solution or for that document alone. click replace.

Cool right?

Developer Guy
  • 2,318
  • 6
  • 19
  • 37
0

Ctrl+alt+H works as it will allow you to change the same word in a file. You should make it a standard practice as it makes you to code quickly.