SortExtension.cs 854 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. namespace assetBundleUtility
  2. {
  3. using System;
  4. using System.Collections;
  5. using System.Collections.Generic;
  6. using UnityEngine;
  7. public static class SortExtension
  8. {
  9. /// <summary>
  10. /// str0µÄASCIIÊÇ·ñ±Èstr1µÄASCIIС
  11. /// </summary>
  12. /// <param name="str0"></param>
  13. /// <param name="str1"></param>
  14. /// <returns></returns>
  15. public static bool CompareASCII(string str0, string str1)
  16. {
  17. for (int i = 0; i < str0.Length; i++)
  18. {
  19. if (i >= str1.Length)
  20. {
  21. return true;
  22. }
  23. else if (str0[i] < str1[i])
  24. {
  25. return true;
  26. }
  27. else if (str0[i] > str1[i])
  28. {
  29. return false;
  30. }
  31. }
  32. throw new Exception();
  33. }
  34. }
  35. }