On Thursday, 21 June 2018 at 18:46:05 UTC, Dr.No wrote:
How can I do that with D?

In C# you can do that:

var filename = @"C:\path\to\my\file.txt";
var file = new Uri(filename).AbsoluteUri;
// file is "file:///C:/path/to/my/file.txt"

How can I do that in D?

I don't know of a specific implementation that does the same, but I can point you to some spots you might look into:

std.path: https://dlang.org/phobos/std_path.html
std.uri: https://dlang.org/phobos/std_uri.html

vibe.inet.url: http://vibed.org/api/vibe.inet.url/URL
vibe.core.path: http://vibed.org/api/vibe.core.path/


I really feel like vibed's documentation api site is missing some nice examples of usage to get a quick feel of the provided api.

Reply via email to