Slightly different bu the same idea, the following code deletes columns that are in a list. Specifically you have a list of columns (all), and items are removed if they are contained in the list excl.
all = dt << Get Column Names(string);
// assume excl is a list of column names that i want to remove
For (i=1,i<=NItems(excl),i++,
pos = Contains(all,excl[i]);
If (pos>0,
RemoveFrom(all,pos)
)
);
-Dave