fork(11) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string file = @"D:\Shared\Common\BaseReports\Another Main.rpt";
  8. string root = @"D:\Shared\Common\BaseReports";
  9.  
  10. var fileUri = new Uri(file);
  11. var rootUri = new Uri(root);
  12.  
  13. var relUri = rootUri.MakeRelativeUri(fileUri);
  14. Console.WriteLine(relUri.ToString());
  15. }
  16. }
Success #stdin #stdout 0.02s 29936KB
stdin
Standard input is empty
stdout
BaseReports/Another%20Main.rpt