Function winsafe::path::replace_extension

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

Replaces the file extension by the given one, returning a new string.

§Examples

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

let p = w::path::replace_extension(
    "C:\\Temp\\something.txt", ".sh"); // C:\Temp\something.sh