N
N
Nastya19202021-05-04 12:31:48
Java
Nastya1920, 2021-05-04 12:31:48

What should Regex be: remove all "\n" between [ and ]?

It is necessary to compose a regex for the replaceAll method:
In the line ": [\nDefault,\nElse,\n] you need to remove all inclusions "\n" (replace with ""), provided that they are within the limits exactly between the square brackets.
Is it real it?I understand how to find those characters between brackets, but how to do replace without deleting text between brackets?
Thanks

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question