Assuming these two strings:
string s1=\"control\"; string s2=\"conrol\"; (or \"ocntrol\", \"onrtol\", \"lcontro\" etc.)
How can I programatical
You can use Levenshtein Distance which would give you a rank on how close the two words are. You need to decide at which rank you do the replace .