You could just add a .ToString()
to the searchItems
variable, e.g:
string msg = "{0:#;;} of {1:#;;} {2:rows;no rows;row} found";
return string.Format(msg, searchItems.ToString(), totalItems, totalItems - 1);
Assuming searchItems
and totalItems
are both 0
:
0 of no rows found
Assuming searchItems
and totalItems
are both 1
:
1 of 1 row found
Assuming searchItems
is 2
and totalItems
is 5
:
2 of 5 rows found
However, I would rewrite this and use an if statement, which may be more lines of code, but is far more readable.