您必须结合Removeand Insert,例如:
strData.Remove(intPosition, intLenght).Insert(intPosition, strValue);
以上假设 的长度strValue等于intLenght。如果strValue可能更长,那么要复制该Mid语句,我们需要执行以下操作:
strData.Remove(intPosition, intLenght)
.Insert(intPosition, strValue.Substring(0, intLenght));