Skip to content
This repository has been archived by the owner on Jul 13, 2024. It is now read-only.

Commit

Permalink
sort list in directory alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahdi-Shah committed Feb 17, 2024
1 parent 8b2fcf7 commit 5fe406e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions TDD/SearchText/PathKeeper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,18 @@ private void SetPathList()
{
list[i] = Directory.GetFiles(this._pathToFolder)[i];
}
_pathList = list;

_pathList = SortList(list);
}


private string[] SortList(string[] list)
{
return list.OrderBy(x => x).ToArray();
}

public string GetIthPath(int i)
{
return this._pathList![i];
return _pathList![i];
}

public List<string> GetPathOfCandidateIndexes(List<int> input)
Expand Down

0 comments on commit 5fe406e

Please sign in to comment.