Is there a way to remove debug statements (usually protected by #defines) from the source code?

I guess it would depend on the source code editor, but has anyone found a way to do this?