title: How to sort directories based on name which is integer?
body: <p>Hi I would like to sort list of directories based on numbers. I have directories named like <code>11-20,1-5,6-10,21-30</code> etc. Now I want to sort them based on numbers in it so that 1 to N directories come in order I mean in order <code>1-5,6-10,11-20,21-30</code>. I am using the following code but its not working.</p>
  
  <pre><code>File[] dirList = mainDir.listFiles();
  Arrays.sort(dirList);
  </code></pre>
  
  <p>I am new to file and directory manipulation in Java please help thanks in advance.</p>