sorting - Human or Natural sort for digits in the middle of string? -


i know natural sorting (or human sorting?) quite on sorting sequence of strings digits. , recently, applied on generated (rendered) image sequences. result looks following:

  • ooxx_1.jpg
  • ooxx_2.jpg
  • ...
  • ooxx_11.jpg
  • ...

what if there suffix characters after digits? sorting result this:

  • ooxx_1.jpg
  • ooxx_1_depth.jpg
  • ooxx_2.jpg
  • ooxx_2_depth.jpg
  • ...

while looking following sorted result:

  • ooxx_1.jpg
  • ooxx_2.jpg
  • ...
  • ooxx_1_depth.jpg
  • ooxx_2_depth.jpg
  • ...

any idea?


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -