CodeTrimmer v2.0 RC

by Angus Turnbull - Updated: 25 June 2006.

Instructions: The top textarea may have your clipboard contents in it already, or you can press Ctrl-V to paste something else or edit it manually. Select how you want it processed, hit the button, and press Ctrl-C to copy the results.

If you're removing spaces around individual characters, you'll want to test the result thoroughly in case the trimming has been overzealous. Also, if removing linebreaks entirely, you'll want to replace } with }; after function(){} blocks, otherwise you'll get errors. Anyway, this should save you a lot of repetitive work. Enjoy!

Removal Options:
Comments: // Single-Line /* Multi-Line */
Spaces: Leading Multiple Trailing
Spaces before these characters:
Spaces after these characters:
Line Breaks: More than in a row.
Redundant Strings: Replace these:

In: Out:


Version History:

v2.0: Rewrote to use RegExps. It can now remove multi-line comments, spaces around chars, and custom numbers of consecutive linebreaks. Also entire-line comments are removed without leaving a blank line, and it can paste clipboard contents in by default onload in IE.

v1.2: Stopped trimming of double slashes in URLs, i.e. http://....

v1.1: Improved the UI a bit, adding code counters.

v1.0: Initial public release.