110,960
社区成员
发帖
与我相关
我的任务
分享
public class Program
{
unsafe static void Main()
{
string str = "yang";
string sss = str;
fixed(char* buf = str)
{
buf[3] = 'm';
}
Console.WriteLine(str); //yanm
Console.WriteLine(sss); //yanm
}
}
StringBuilder sb = new StringBuilder(str);
sb[3] = m;
str = sb.ToString();