Possible Duplicate:
Search and Replace Entire Project (Netbeans)
Other IDE's have a feature to find and replace something in code. I want this feature in Netbeans. I know there is the refactor feature, but that's only for variables. How can I find and replace text that isn't a variable name?
To replace one string with another string using Java Regular Expressions, we need to use the replaceAll() method. The replaceAll() method returns a String replacing all the character sequence matching the regular expression and String after replacement.
To select the word in which the cursor is resting and start searching for other occurrences of that word, press Ctrl-F3. To search and replace text, click in the file that you want to replace text, press Ctrl-H, and fill in the Find What and Replace With fields.
Java String replace() MethodThe replace() method searches a string for a specified character, and returns a new string where the specified character(s) are replaced.
Use two parameter form of indexOf and start searching at previously found position + 1.
CTRL+SHIFT+H will open the replace dialogue where you can find+replace in any or all of your open projects.
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