C# 在字符串中删除子字符串示例

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication4

{

  class Program

  {

      static void Main(string[] args)

      {

          string sentence = "Onitroad.com a tutorial website for info-technology.";

          Console.WriteLine("Oroirnal String: {0}", sentence);

          sentence = sentence.Remove(10, 13);

          Console.WriteLine("Final String");

          Console.WriteLine(sentence);

          Console.ReadLine(); 

      }

  }
}
C# 删除字符串

在本文中,我们将讨论如何在C#中删除字符串。

C# 字符串类的Remove方法从指定位置删除指定数量的字符串。
此方法将结果返回为字符串。

日期:2020-04-11 23:03:49 来源:oir作者:oir