method str.replaceFirst
Replaces only the first occurrence.
Example:
fn main() io {
print("a-b-c".replaceFirst("-", "+"))
}Output
a+b-c
pub(api) fn replaceFirst(from: str, to: str) -> strSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
from | str |
to | str |
Returns
str
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/text.oxl:683