Ser Pounce
Ser Pounce

Reputation: 14571

Deleting Line of Text Using Xcode Find and Replace

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?

Upvotes: 13

Views: 3320

Answers (2)

Jurasic
Jurasic

Reputation: 1956

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

Upvotes: 12

user1920690
user1920690

Reputation: 316

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.

Upvotes: 30

Related Questions