<分区>
我(希望)有一个简单的问题。
String.Insert(0, "test");
还没有工作:
String.Text += "test";
有没有……?我需要 Insert 以便我可以在字符串中间插入一些东西。
<分区>
我(希望)有一个简单的问题。
String.Insert(0, "test");
还没有工作:
String.Text += "test";
有没有……?我需要 Insert 以便我可以在字符串中间插入一些东西。
最佳答案
我真是个白痴,谷歌即时搜索解决了这个问题。
String.Insert 不会修改调用它的字符串,而是返回一个包含插入文本的新字符串。
所以我需要:
String = String.Insert(0, "test");
关于c# - String.Insert 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31216892/