code: private void deleteTOCTag(SpanManager sm)
  	{
  		// delete all __TOC__ from SRC
  		int temp = 0;
  		while ((temp = sm.indexOf("__TOC__", temp)) != -1)
  		{
  			sm.delete(temp, temp + 2 + 3 + 2);
  		}
  
  		// delete all __NOTOC__ from SRC
  		temp = 0;
  		while ((temp = sm.indexOf("__NOTOC__", temp)) != -1)
  		{
  			sm.delete(temp, temp + 2 + 5 + 2);
  		}
  	}
docs: Deleteing ALL TOC Tags