private string RemoveComments_others(string str)//14May2014
{
if (str == null || str.Length < 1)
return null;
int len = str.Length;
int sidx = str.IndexOf("#"); // very first, index of "#"
int eidx = 0, remvlen = 0;
if (sidx < 0) // if there is no comment
return str;
for (; ; )
{
eidx = str.IndexOf(";", sidx);
remvlen = eidx - sidx;
str = str.Remove(sidx, remvlen);
sidx = str.IndexOf("#");
if (sidx < 0)
break;
}
return str;
}