C#字符串中替换指定位置指定长度的子字符串

例如字符串“1abc23abc2abc”要求替换第6位开始长度为3的子字符串“abc”替换为“def”求大神解答,感谢

s = "1abc23abc2abc";
s = s.SubString(0, 3) + "def" + s.SubString(6);

public static string Replace(string s,int index,string oldstring,string newstring)
{
string temp="";
int sindex=s.IndexOf(oldstring, (index - 1));

    temp = s.Substring(0, sindex) + newstring + s.Substring(sindex + oldstring.Length);

    return temp;
}