OxL Reference

method Regex.replaceAll

Replaces every match.

Example:

oxl✓ checked in CI
fn main() io {
  let re = Regex.compile("[0-9]+")!
  print(re.replaceAll("a1b22", "#"))
}
Output
a#b#
pub(api) fn replaceAll(s: str, with: str) -> str

Since. 1.0.0-beta

Parameters

NameType
sstr
withstr

Returns

str

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/text.oxl:1380

See also