我正在尝试使用条件字符串格式来显示找到或不这样的记录“找到 10 行中的 5 行”
string msg = "{0:#;;} of {1:#;;} {2:rows;no rows;row} found";
return string.Format(msg, searchItems, totalItems, totalItems - 1);
一切都很好,直到 totalItems 为 0 因为那时我得到了这样的消息集。“未找到行”(错误)
我想要这样的“找不到行”
searchItems = 0 ; totalItems = 0 ==> "no rows found"
searchItems = 1 ; totalItems = 1 ==> "1 row found"
searchItems = 2 ; totalItems = 5 ==> "2 of 5 rows found"