method Path.withExtension
The path with its extension replaced by ext (added when there is none).
Example:
use std.io { Path }
fn main() io {
print(Path.of("a/main.oxl").withExtension("o").text)
}Output
a/main.o
pub(api) fn withExtension(ext: str) -> PathSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
ext | str |
Returns
Effects
none declared (pure unless the body says otherwise)
Defined in: std/io/io.oxl:976