Why does the string Remove() method allow a char as a parameter?

you try to remove ‘x’ which is a declared as char, x is equal to 120

The .Remove only takes 2 parameters of type int the start and (optional) count to remove from the string.

If you pass a char, it will be converted to the integer representation. Meaning if you pass ‘x’ -> 120 is greater than the string’s .Length and that’s why it will throw this error!

Leave a Comment

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