The most concise way to extract a file name extension

What would be the most concise way to extract an extension from a file name string (including and not including the last dot . ) In D? Right now I'm using lastIndexOf() . Is there a cleaner / preferred way?

+6
source share
1 answer

Use std.path.extension . eg.

 assert("file.foo".extension == ".foo"); 
+8
source

Source: https://habr.com/ru/post/971265/


All Articles