string TargetString; // We replace here
string key; // replace what
string NewKey; // replace with this
We will find the position ot which the string is, remove the old and add a new one. But to be case sensitive we will search when both strings are in Lower
int pos =targ.ToLower().IndexOf(key.ToLower);
// if there is a match
if (pos <>-1 )
{
// remove old
targ.Remove(pos,key.Length);
// add the newkey
targ.Insert(pos,Newkey);
}
I just forgot the pos function and I am not sure weather pos returns 0 or -1 if sub string is not found.
Good Luck