问题:
c#中的insert操作
代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class test
{
static void Main(string[] args)
{
string old = "abcdefg";//原始字符串
string insert = "fff";//要插入的字符串
Console.WriteLine(old);//查看原来的字符串变化
old = old.Insert(1, insert);
Console.WriteLine("查看第一次插入后的old的变化:" + old);
old = old.Insert(0, insert);
Console.WriteLine("查看第一次插入后的old的变化:"+old);
Console.ReadLine();
}
}
运行结果:、