---
title: "replace"
sidebar_label: "replace"
description: "Kotlin binding reference: replace."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Regex](index.md)/[replace](replace.md)

# replace

[common]\
fun [replace](replace.md)(text: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), rewrite: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)

Rewrite the first match in [text](replace.md) with [rewrite](replace.md) (`\0`..`\9` name the groups); the text unchanged when none.