Quote:
The problem is that it needs to return three values, two bool, and one string.
Depends on what you need, and how much old C# language you need to support. But the latest version of C# can handle a Tuple easily.
private Tuple<bool, bool, string> VerifyDate(string thisDay, object[] status) {
It should work just fine, and this would return the three values.
Read more here:
Tuple types - C# reference | Microsoft Docs[
^]
More latest versions of the language will enable you to return the tuple structure with a more syntactic-sugar syntax:
private (bool, bool, string) VerifyDate(string thisDay, object[] status) {
However, if you need to label the fields, it would be better to simply create a
struct
. The structures would provide better performance over class simply because they are put on the stack and not the heap.