method str.replaceFirst
Replaces only the first occurrence.
Example:
fn main() io {
print("a-b-c".replaceFirst("-", "+"))
}Вывод
a+b-c
pub(api) fn replaceFirst(from: str, to: str) -> strС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
from | str |
to | str |
Возвращает
str
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/text.oxl:683