RuntimeBinderException: The best overloaded method match for 'string.Replace(char, char)' has some invalid arguments

Question: How do you resolve the C-Sharp #MVC error that says "#RuntimeBinderException: The best overloaded method match for 'string.Replace(char, char)' has some invalid arguments".


Please Login to see the rest of the answer

Answer: It is most likely that you are trying to replace a String with an Integer. The #Replace function won't work with Integers, it expects the oldValue String to be replaced by the newValue String.

[Notes from Visual Studio Intelisense]: A #String that is equivalent to the current string except that all instances of oldValue are replaced with newValue. If oldValue is not found in the current instance, the method returns the current instance unchanged.

Let me know if this helped you, if it did please leave us a comment below.


Write an Article
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.


© 2022 - ErnesTech - Privacy