I'm trying to use conditional string format in order to show records found or not like this "5 of 10 rows found"
string msg = "{0:#;;} of {1:#;;} {2:rows;no rows;row} found";
return string.Format(msg, searchItems, totalItems, totalItems - 1);
Everything works very well until totalItems is 0 because then I got the message set like this. " of no rows found" (WRONG)
I would like something like this "no rows found"
searchItems = 0 ; totalItems = 0 ==> "no rows found"
searchItems = 1 ; totalItems = 1 ==> "1 row found"
searchItems = 2 ; totalItems = 5 ==> "2 of 5 rows found"