MessageBox.Show((some_string.Length).ToString);
I am getting two errors for this:
-
The best overloaded method match for ‘System.Windows.Forms.MessageBox.Show(string)’
-
Argument ‘1’: cannot convert from ‘method group’ to ‘string’
Can someone tell me how to do this correctly?
Functions need brackets when they are called, you are missing
()at the end ofToStringThe errors:
Error 1 The best overloaded method match for ‘System.Windows.Forms.MessageBox.Show(string)’
This is just saying that it is expecting a string (
MessageBox.Show()), and you did not provide it with one.Error 2 Argument ‘1’: cannot convert from ‘method group’ to ‘string’
This is saying that you cannot convert a method group (
ToStringwithout brackets to make it a function call) as a string parameter in the required method.