Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deleting Line of Text Using Xcode Find and Replace

Tags:

xcode

I'm wondering if it's possible to search for a certain line of a text using Xcode's Find & Replace feature, and fully delete the line so not even blank space is left over. Is this possible and if so how?

like image 872
Ser Pounce Avatar asked Dec 21 '12 22:12

Ser Pounce


2 Answers

Copy the line you want to delete, including the newline character at the end of the line by triple-clicking on it (the selection should go all the way to the far right side of the editor pane). Perform a find and replace; paste the line into the the top field, and leave the replace field blank. Click Replace All.

like image 92
user1920690 Avatar answered Nov 17 '22 17:11

user1920690


On the latest Xcode you can just insert line break in the search field. Click on magnifying glass icon -> insert pattern -> Line Break

enter image description here

like image 44
Jurasic Avatar answered Nov 17 '22 15:11

Jurasic