我用C#编写一个程序指定插入数据问题

来源:百度知道 编辑:UC知道 时间:2024/05/13 14:05:36
我用C#插入数据如下:

string tab="我爱你,大人";
我想在第4个字符插入(老婆)

输出是:(我爱你老婆大人),

怎么实现 这个方法

string tab = "我爱你,大人";
string s = tab.Insert(4,"老婆");

把“大人”替换成“老婆大人”

第四个字符? 还是吧 “,”替换?
tab=tab.Replace(tab.sunstring(3,1),"老婆");

tab=tab.Replace(",","老婆");