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)
}Вывод
a/main.o
pub(api) fn withExtension(ext: str) -> PathС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
ext | str |
Возвращает
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/io/io.oxl:976