排序字符串,一些项存在但长度为零,一些不见了
Sorting strings where some items are present but have zero length and some are absent
这个例外就是xsl: sort指令,它的lang属性告诉处理程序应该按照和指定语言的文化传统一致的方式排序字符串。
The exception is the XSL: sort instruction, where the lang attribute tells the processor that it should sort strings in a manner consistent with the cultural conventions of the specified language.
所幸的是,intl库提供了collator类(以及名字以collator _开头的影子函数),可用来根据特定的locale对比和排序字符串。
Luckily, the intl library provides the collator class (and shadow functions with names starting with collator_), which you can use to compare and sort strings with respect to your selected locale.
应用推荐