- <plurals name="book">
- <item name="one">book</item>
- <item name="others">books</item>
- </plurals>
-
- int bookCount = 4;
- Resources res = getResources();
- String bookCount = res.getQuantityString(R.plurals.book, bookCount);
- // result: books.
-
Quantity String 不仅支持 one,还支持 zero, two, few, many 和 other。
参考:Android strings.xml使用方法及技巧_Android_脚本之家

换行:
