I am working on a wiki bot for my communities wiki that uses the DotNetWikiBot Framework; it is to find a word that is commonly a typo (such as "abilty") and replaces them with the correction (such as "ability").
This works as is is coded:
p.text = p.text.Replace(@"\b" + typoArray[x, 0] + @"\b", typoArray[x, 1]);
However this will replace "Abilty" with "ability" which is of course going to cause issues, but I cannot figure out how to preserve the case of the replaced word (so Abilty becomes Ability) unless the typo replacement is meant to be capitalized, no matter what it is replacing: januray to January