I’m participating in one of the Code Golf competitions where the smaller your file size is, the better.
Rather than manually removing all whitespace, etc., I’m looking for a program or website which will take a file, remove all whitespace (including new lines) and return a compact version of the file. Any ideas?
You could use:
There is also this online tool.
You can even do it in PHP (how marvelous is life):
You have to note this won’t take care of a string variable like
$bar = ' asd aa a';it might be a problem depending on what you are doing. The online tool seems to handle this properly.