aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets/string_replace.md
blob: e88179de62dd0768c3914765db60a623887883ab (plain)
1
2
3
4
5
6
7
8
9
10
## String `.replace()`

String objects now have a method called replace for replacing all instances of a
substring in a string with another.

```meson
s = 'aaabbb'
s = s.replace('aaa', 'bbb')
# 's' is now 'bbbbbb'
```