Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why can't a static method return a boolean?

Status
Not open for further replies.

qotyebw

Programmer
Aug 24, 2000
103
US
This version works...
private static string Check4Palindrome(string inString)
{
.....
.....
return "true";
}


But, this won't. Debug info says to instantiate an object first..
private static bool Check4Palindrome(string inString)
{
.....
.....
return true;
}


I'd like to know why this is, so I can avoid further dispair!
 
There's no reason why it can't return a bool.

Hmmm. Are you including the System namespace?

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
This has been a "red herring" issue. The same code now works when written in a fresh new solution/project.

Thanks anyway..
 
Compare your .csproj files for differences.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top