using System;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
string str = "我是中国人";
str = str.Substring(2);// 取字符串的字串,从指定的位置开始一直到字符串结束
Console.WriteLine(str);// 中国人
str = str.Substring(2, 1);// 第二个参数是长度
Console.WriteLine(str);// 人
Console.ReadKey();
}
}
}
取字符串的字串
最新推荐文章于 2023-06-10 15:39:03 发布