C#-format-删除字符串---ShinePans

来源:互联网 发布:阿里云服务器怎么降配 编辑:程序博客网 时间:2024/05/22 12:12
using System;class program{    static void Main(string[] args)    {        while(true)        {            Console.WriteLine("请输入字符串:");            string str1 = Console.ReadLine();            string str2=str1.Remove(0,5);            Console.WriteLine("第一次删除(删除索引0-索引5之间的字符:"+str2);            string str3=str1.Remove(3);            Console.WriteLine("第二次删除(删除索引3之后的所有的字符:"+str3);            Console.ReadLine();                                }        }    }

0 0
原创粉丝点击