Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
stripcs
function stripcs {
$acc = "";
foreach($l in $input) {
$k = $l;
$i = $k.IndexOf("//");
if ($k.Contains("~lcom~")) {
$i = $k.LastIndexOf("//");
}
if ($i -gt -1) {
$k = $k.SubString(0, $i);
}
$k = $k.Trim();
if ($k.EndsWith("else") -or $l.Contains("~space~")) {
$k += " ";
}
$acc += $k;
}
while ($acc.Contains("/*")) {
$acc = $acc.Remove($acc.IndexOf("/*"), $acc.IndexOf("*/") - $acc.IndexOf("/*") + 2);
}
$acc;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.