我正在尝试在 C# 字符串的位置插入一个字符串,但失败了
这是片段。
if(strCellContent.Contains("<"))
{
int pos = strCellContent.IndexOf("<");
strCellContent.Insert(pos,"<");
}
请告诉我解决方法
最佳答案
返回值包含您想要的新字符串。
strCellContent = strCellContent.Insert(pos,"<");
关于c# - c#中的字符串插入问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5401869/