问题
i am having the field which has data in this way .
A_0121-X-1
A_0121-X-10
A_0121-X-11
A_0121-X-2
A_0121-X-3
A_0121-Z-1
A_0121-Z-11
A_0121-Z-12
A_0121-Z-13
A_0121-Z-2
A_0121-Z-3
S0 How to sort numerically like this
A_0121-X-1
A_0121-X-2
A_0121-X-3
A_0121-X-10
A_0121-X-11
A_0121-Z-1
A_0121-Z-2
A_0121-Z-3
A_0121-Z-11
A_0121-Z-12
A_0121-Z-13
Thanks in advance
回答1:
i think you mean to natural sort in js
look on Brian Huisman solution
https://web.archive.org/web/20130929122019/http://my.opera.com/GreyWyvern/blog/show.dml/1671288
来源:https://stackoverflow.com/questions/4321829/alphanumeric-sorting-in-java-script