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!