To find and replace text using the Find and Replace dialog box, follow these steps:
1. Choose Search > Find and Replace.
2. Enter in the Find field the text to find.
For example, to find occurrences of the text main, enter main in the Find field.
3. Enter in the Replace field the text to substitute for each occurrence of the text in the Find field.
4. Configure the search criteria.
See "General Search Options", "Multi-File Search Options", and "Searching with Special Characters" for more information.
For more information about finding and replacing individual occurrences, see "Selective Find and Replace." For more information about finding and replacing all occurrences, see "Replace All".
To learn how to find text in the active editor window without replacing matching text, see "Finding Text".
To find and replace individual occurrences of text, you must first complete the steps described in "Finding and Replacing Text." After completing those steps, continue with the additional steps described in this section.
To selectively find and replace text, follow these steps:
1. Click the Find button in the Find and Replace dialog box, or choose Search > Find.
Using the search text in the Find field and the search criteria defined in the Find and Replace dialog box, the IDE searches the active editor window for matching text. If successful, the IDE closes the Find and Replace dialog box, then displays and selects the matching text in the editor window. If unsuccessful, the IDE beeps.
2. Choose the desired menu command from the Search menu.
Choose the menu command that performs the desired task:
Replace Selection substitutes the matching text with the text that you entered in the Replace field of the Find and Replace dialog box.
Replace Selection operation immediately followed by a Find Next operation. The effect is to replace the current matching text, then locate the next occurrence of matching text.
Replace Selection operation immediately followed by a Find Previous operation. The effect is to replace the current matching text, then locate the previous occurrence of matching text.
NOTE
Replace and Find Previous menu command by default. See "Customizing Commands" to learn how to enable the menu command.
You can repeatedly choose the Replace and Find Next or Replace and Find Previous menu commands to continue replacing and finding other matches. The IDE beeps after failing to locate additional occurrences.
To replace all occurrences of matching text, you must first complete the steps described in "Finding and Replacing Text". After completing those steps, click the Replace All button in the Find and Replace dialog box. You can also choose Search > Replace All if you wish to use the existing criteria in the Find and Replace dialog box.
WARNING!
Replace All. However, if you save the file prior to using Replace All, you can use Revert to restore the file to its original state. This technique works as long as you do not save any changes after using Replace All, and you do not work across multiple files.