Function winsafe::PathCommonPrefix

source ·
pub fn PathCommonPrefix(file1: &str, file2: &str) -> Option<String>
Available on crate feature shell only.
Expand description

PathCommonPrefix function.

§Examples

use winsafe::{self as w, prelude::*};

if let Some(common_prefix) = w::PathCommonPrefix(
    "C:\\temp\\one\\foo.txt",
    "C:\\temp\\two\\bar.txt",
) {
    println!("Common prefix: {}", common_prefix); // "C:\\temp"
}