Если Вы используете.NET 3.5, взглянули на Счетное. Метод броска. Это - дополнительный метод, таким образом, можно назвать его непосредственно в Списке.
List<string> sl = new List<string>();
IEnumerable<object> ol;
ol = sl.Cast<object>();
Это не точно, что Вы попросили, но должны добиться цели.
Редактирование: Как отмечено Zooba, можно тогда назвать ol. ToList () для получения Списка
Minifiers,obfuscators and compressors have been designed to solve the issue of downloading external elements when loading a page. They were never meant to be used for inline JavaScript or CSS since lots of that is normally kept outside of the page in a separate file.
Since you should be gzipping as much as you can, for browsers that can handle gzip, it shouldn't in reality matter that your inline css/javascript isn't minified on the page.
Если вы используете PHP, вы можете вызвать таким образом компилятор google, а затем использовать заголовок для возврата javascript
<?php
$script = file_get_contents('http://www.domain.com/scripts/script.js');
$ch = curl_init('http://closure-compiler.appspot.com/compile');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'output_info=compiled_code&output_format=text&compilation_level=SIMPLE_OPTIMIZATIONS&js_code=' . urlencode($script));
$output = curl_exec($ch);
curl_close($ch);
header('Content-type: application/javascript');
echo $output;
?>