Replacing each instance of a string literal with a constant

Answered

I looked and could only find one very old post about this and the answer is no longer valid.   I'd like to replace ALL instances of a particular string literal in a file.  Sonar finds one, I replace it and then have to do a "replace all" to catch the other ones.  I swear this has worked before but just on occasion.   Not saying there's a bug, just don't know what I did to make it work.  Just using ctrl-alt-C to do this. 

0
2 comments

Extract Constant refactoring has an option to replace all occurrences, please refer to https://www.jetbrains.com/help/idea/extract-constant.html.

If it doesn't work for you, please share a small sample project with the exact steps to reproduce the issue: https://uploads.jetbrains.com.

1

Thank you!  You're the dopest!

0

Please sign in to leave a comment.