Remove single character from string?

How to remove one character from a string?

string = string.Remove(3);

but it removes the third char and everything else.

+5
source share
4 answers

In accordance with the signature removal method :

public string Remove(
    int startIndex,
    int count
)

you need to specify the second parameter as the total number of characters to remove from startIndex:

string = string.Remove(3, 1);
+13
source

string = string.Remove(3,1);

0

, String.Remove() "" -, . .

String.Remove(3,1) .

0

All Articles