📜  c# 在 C# 代码示例中删除字符串

📅  最后修改于: 2022-03-11 14:48:51.378000             🧑  作者: Mango

代码示例2
//The following example removes all characters from a string that are after 25th position in the string.

string founder = "Mahesh Chand is a founder of C# Corner";  
// Remove all characters after first 25 chars  
string first25 = founder.Remove(25);  
Console.WriteLine(first25);  
//************************************   ^_*
//The following example removes 12 characters from the 10th position in the string.

// Remove characters start at the 10th position, next 12 characters  
String newStr = founder.Remove(10, 12);  
Console.WriteLine(newStr);