OxL Справочник OxL
РусскийEnglish

method Regex.replace

Replaces the first match; $1, ${name}, $0 and $$ in with refer to groups (unknown groups expand to nothing).

Example:

oxl✓ проверяется в CI
fn main() io {
  let re = Regex.compile("[0-9]+")!
  print(re.replace("a1b22", "#"))
}
Вывод
a#b22
pub(api) fn replace(s: str, with: str) -> str

С версии. 1.0.0-beta

Параметры

ИмяТип
sstr
withstr

Возвращает

str

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/core/text.oxl:1367

См. также