Function winsafe::path::replace_path

source ·
pub fn replace_path(full_path: &str, new_path: &str) -> String
Available on crate feature kernel only.
Expand description

Keeps the file name and replaces the path by the given one, returning a new string.

§Examples

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

let p = w::path::replace_path( // C:\another\foo.txt
    "C:\\Temp\\foo.txt",
    "C:\\another",
);