C#文字列Remove
Insert

Remove文字列

Replace

指定した位置から文字を削除します。

構文

str.Remove(startIndex, count?)

使用例

下記の値を入力するとサンプルに即時反映されます。

string
result
Remove
Console
WriteLine
string text = "Hello, World!";
string result = text.Remove(5, 2);
Console.WriteLine(result);   // "HelloWorld!"