Go to one end of the code you want to delete (either beginning or end). Then set a "mark" by hitting control-space (C-space). (An alternative is M-x set-mark.) Then, go to the other end and hit C-w. This will do a cut.
You can then paste it back anywhere else by hitting C-y. |