Issue
I'm trying to replace parts of my code in a file that all have quotation marks around them. They look like this:
public static Map<String, String[]> "acidspray" = Map.ofEntries(
public static Map<String, String[]> "acrobatics" = Map.ofEntries(
etc.
I wanna be able to just remove the quotes around the variable names. I've tried looking up how to use wildcards in the Find/Replace feature, but either I'm not understanding it or my situation is different than what I've been seeing. Some help would be awesome.
Solution
You will have to use a Regular Expression find/replace for that - so check the "Regular expressions" check box in the dialog.
The find string could be:
"(\w+)" =
which finds a "
followed by one or more word characters followed by " =
and captures the word characters. I have included the =
to restrict the match to just assignments.
The replace string:
\1 =
\1
uses the word characters captured by the find pattern, followed by the =
.
Answered By - greg-449
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.