110,539
社区成员
发帖
与我相关
我的任务
分享
class Program
{
static void Main(string[] args)
{
StringBuilder s = new StringBuilder("123456789");
Console.WriteLine("返回值:{0},修改之后值:{1}", s.Shift(3), s);
Console.ReadKey();
}
}
static class MyClassMethod
{
public static string Shift(this StringBuilder s, int length)
{
string result = s.ToString().Substring(0, length);
s = s.Remove(0, length);
return result;
}
}