Finding and replacing text in Intellij IDEA
Asked Answered
D

1

20

What do I have:

More then 100 lines of fields with same structure:

var type1Name:String = "<some text>";
var type2Name:String = "<some text>";

<some text> is always different. name is always same.

What I want:

Delete all <some text> in all fields. This is more likely to "find and replace" operation, to find something like Name:String = "***"; and replace it with Name:String = ""; in all cases.

How can i do this with Intellij IDEA?

Dyad answered 4/3, 2015 at 5:58 Comment(0)
P
32

if it is in one file : ctrl + r check the tick box Regex and look for Name:String = \"[^\"]*\" : this should match what you want.

Then replace it with whatever you want.

If it is in multiple file, use ctrl + shift + r

Parhelion answered 4/3, 2015 at 6:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.