meson/docs/markdown/snippets/string_replace.md

218 B

String .replace()

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

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