I have a class and a method within that class. However this class method returns a string. When I call the class method I don't get an error even though I'm not catching the string value return. Is there a way that I can make C# and .net force me to capture the value when returning a value. Here is an example of what I mean.
1- create a class test.
class test
{
public string mystring() {
return "BLAH";
}
}
2- call the class method from program or another class
test mystring = new test();
mystring.mystring();
My compiler while working in Visual Studio does not complain that I'm not capturing the return value. Is this normal or I'm missing something. Can I force the compiler to notify me that the function returns a value but I'm not catching it?
Thanks in advance for any suggestions you may have.