How to remove line contains starting with NSLog iOS? -
i have nslogs in code, many time. easy solution replace
nslog(@ //nslog(@
but, if want remove lines, starting nslog, can do?
thanks
in xcode search , replace project navigator. can select "starting with", "contains", "regular expression", etc.
using regular expression ^[\s\w]+nslog.*$
should work lines might have tab or space before nslog
won't catch lines other text may in front of it. (notice in second screen shot nslog
detected @ end of line, while first didn't).
another example might if want keep commented nslog
lines , remove others:
^[^/*]*[\s\t]*nslog.*$
would remove nslog
on line 3 , nslog(@"%@",removed);
on line 7.
// nslog /* nslog */ nslog nsstring *nslog = @"not nslog" nslog(@"%@",removed);
additional examples:
Comments
Post a Comment