Find and Replace

The Find and Replace menu is a useful way to search for specific text in your files, and replace it, if you so choose. To launch the Find/Replace tab, either use the keyboard shortcut Ctrl-F or choose "Edit, Find and Replace" from the menu at the top of the DrJava window. Once you do this, the Find/Replace tab will appear at the bottom of the screen. Type the text you want to search for in the "Find Next" box, and if you want to replace it with anything, type that in the "Replace With" box. Then, chose which of the four options to the right of those text boxes that you want to use, and press one of the buttons at the bottom, or the Enter key. The direction of the search executed by pressing the Enter key depends on the direction of the last search. (The last direction is indicated by the label of the Find box: "Find Next" or "Find Prev").

To go from instance to instance of your search text, use the four buttons at the bottom.

A relatively new feature of Find and Replace is the ability to search across more than one line of text. The Find and Replace text boxes can accept more than one line of text. To use this feature you have two options. First, you can copy/paste directly into the Find and Replace boxes and search/replace as normal. Second, you can type text directly into the boxes, and when you want to create a new line press Ctrl-Enter (Note: Pressing only the Enter key when inside the Find box executes a Find. It DOES NOT create a new line. Both Enter and Ctrl-Enter create a new line inside the Replace box).