Maro
Maro

Reputation: 2629

Remove Last and begin specific character from String

I want to remove a specific character from the end and the beginning of string.

Example:

Any idea

Upvotes: 1

Views: 72

Answers (2)

I4V
I4V

Reputation: 35353

string s = ";Maro;Mike;Tim;";
string s2 = s.Trim(';');

Upvotes: 6

Vladimir
Vladimir

Reputation: 7475

Try this:

input.Trim(";".ToCharArray())

Upvotes: 4

Related Questions