String.Remove() method removes a given number of characters from a string at a specified position. The position is a 0 index position. That means, the 0th position is the first character in the string.
In C#, Strings are immutable. That means, the method does not remove characters from a string. The method creates and returns a new string without those characters.
String.Remove() method has two overloaded forms.
| Method | Description |
| Remove(Int32) | Returns a new string in which all the characters in the current instance, beginning at a specified position and continuing through the last position, have been deleted. |
| Remove(Int32, Int32) | Returns a new string in which a specified number of characters in the current instance beginning at a specified position have been deleted. |
Example 1
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 10th position, next 12 characters
- String newStr = founder.Remove(10, 12);
- Console.WriteLine(newStr);
Example 2

Pankajkumar PatelPosted Sep 27, 2019, 12:24 AM
Nice article
Madan ShekarPosted Sep 26, 2019, 2:12 AM
Nice information ........ i know string is immutable after reading this blog i understood properly ...
Amit KumarPosted Sep 23, 2019, 11:41 PM
Nice One Sir..