《零基础学C#》第六章-实例08:stringBuilder——练习1

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wtxhai/article/details/88715888
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Example608_01
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("小侄子出的题目:");
            StringBuilder sTitle = new StringBuilder("(),(),(),2、4、6、7、8");
            Console.WriteLine(sTitle);
            sTitle.Remove(0, 9);//移除前9个字符
            sTitle.Insert(0, "(门前大桥下),(游过一群鸭),(快来快来数一数),");//在可变字符串的开始处插入答案
            Console.WriteLine("\n正确答案:\n" + sTitle);
            Console.ReadLine();
        }
    }
}

猜你喜欢

转载自blog.csdn.net/wtxhai/article/details/88715888