How to remove all instances of a specific character from a string?

You must assign the return value of String.Replace to your original string instance:

hence instead of(no need for the Contains check)

if (Gamertag2.Contains("^"))
{
    Gamertag2.Replace("^" + 1, "");
}

just this(what’s that mystic +1?):

Gamertag2 = Gamertag2.Replace("^", "");

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)