Utility.cs 644 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Text;
  5. using System.Linq;
  6. namespace FsDb.Test
  7. {
  8. internal static class Utility
  9. {
  10. public static string CombineLocalPath(this string me, params string[] nexts)
  11. {
  12. if (me == null || nexts.Length == 0)
  13. throw new ArgumentNullException();
  14. string dsc = Path.DirectorySeparatorChar.ToString();
  15. var lst = nexts.ToList();
  16. lst.Insert(0, me);
  17. return string.Join(
  18. dsc
  19. , lst.ToArray()
  20. )
  21. ;
  22. }
  23. }
  24. }