简体   繁体   中英

Using Search and Replace in Eclipse, how do you replace a string with a multi-line String

Eclipse查找并替换

Using the eclipse Search and replace functionality, I was to search for a single line string and replace it with a multi-line string. I already attempt to use \\n and /n to insert a new line.

在此处输入图片说明

You just have to ensure the "Regular Expression" box is checked before performing the search. Then in the replace dialog you will also have a "Regular Expression" box which must be checked. Then you separate each new line with a new line character "\\n" in the replacement string.

Example:

<!-- Google Analytics -->\n     <script type="text/javascript">\n code\n

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM