User:Thurstan/AWB Code

Add DEFAULTSORT
private string AddDefaultSort(string ArticleText, string ArticleTitle, int wikiNamespace, ref string Summary, ref bool Skip) {		int iBrack;

iBrack = ArticleTitle.IndexOf(" (");		if (iBrack > -1)		{			string sSub;			int i;			int iWhere;			if (ArticleText.IndexOf("({{DEFAULTSORT:") > -1) {				return ArticleText; }			sSub = ArticleTitle.Substring(0, iBrack); i = sSub.LastIndexOf(" "); iWhere = ArticleText.IndexOf("[[Category:");			ArticleText = ArticleText.Insert(iWhere, "\n{{DEFAULTSORT:" + sSub.Substring(i+1) + ", " + sSub.Substring(0, i) + "}}\n");			Skip = false;		}		return ArticleText;       }